Commit 9759fb64 authored by Ioannis Papagiannopoulos's avatar Ioannis Papagiannopoulos Committed by Jérome Perrin

correction in sortOperators of router

parent 3aebce38
......@@ -359,10 +359,11 @@ class Router(ObjectInterruption):
op.waitingTime=0
if op.schedule:
op.waitingTime=self.env.now-op.schedule[-1][-1]
# sort according to the time they concluded their last operation
elif self.env.now>0:
op.waitingTime=self.env.now
print 'before', [[x.id, x.waitingTime] for x in self.candidateOperators]
self.candidateOperators.sort(key=lambda x: x.waitingTime, reverse=True)
#===========================================================================
# find working stations for the candidateOperators
#===========================================================================
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment