Commit d97155ee authored by Georgios Dagkakis's avatar Georgios Dagkakis

SkilledRouter to wait for events and also not consider operators that are off-shift

parent 4a0fc4ec
...@@ -75,6 +75,15 @@ class SkilledRouter(Router): ...@@ -75,6 +75,15 @@ class SkilledRouter(Router):
self.expectedSignals['isCalled']=1 self.expectedSignals['isCalled']=1
yield self.isCalled yield self.isCalled
# wait till there are no more events, the machines must be blocked
while 1:
if self.env.now==self.env.peek():
self.printTrace('', 'there are MORE events for now')
yield self.env.timeout(0)
else:
self.printTrace('','there are NO more events for now')
break
transmitter, eventTime=self.isCalled.value transmitter, eventTime=self.isCalled.value
self.isCalled=self.env.event() self.isCalled=self.env.event()
self.printTrace('','=-'*15) self.printTrace('','=-'*15)
...@@ -185,7 +194,7 @@ class SkilledRouter(Router): ...@@ -185,7 +194,7 @@ class SkilledRouter(Router):
#=================================================================== #===================================================================
self.availableOperatorList=[] self.availableOperatorList=[]
for operator in G.OperatorsList: for operator in G.OperatorsList:
if operator.available: if operator.available and operator.onShift:
self.availableOperatorList.append(operator.id) self.availableOperatorList.append(operator.id)
#=================================================================== #===================================================================
# # XXX run the LP assignment algorithm # # XXX run the LP assignment algorithm
......
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