Commit 76363b51 authored by Ioannis Papagiannopoulos's avatar Ioannis Papagiannopoulos Committed by Georgios Dagkakis

in case of single-machine-dedicated-skilled operators, the broker does not invoke the Router.

parent bb51d0ad
...@@ -80,11 +80,12 @@ class Broker(ObjectInterruption): ...@@ -80,11 +80,12 @@ class Broker(ObjectInterruption):
and any(type=='Load' or type=='Setup' or type=='Processing'\ and any(type=='Load' or type=='Setup' or type=='Processing'\
for type in self.victim.multOperationTypeList): for type in self.victim.multOperationTypeList):
# update the time that the station is waiting for the operator # update the time that the station is waiting for the operator
self.timeWaitForOperatorStarted=self.env.now#() self.timeWaitForOperatorStarted=self.env.now
#=============================================================== #===============================================================
# if the victim already holds an entity that means that the machine's operation type # if the victim already holds an entity that means that the machine's operation type
# is no Load or setup, in that case the router is already invoked and the machine is already assigned an operator # is no Load or setup, in that case the router is already invoked and the machine is already assigned an operator
from Globals import G from Globals import G
if not self.victim.checkForSkilledOperators():
if not self.victimQueueIsEmpty(): if not self.victimQueueIsEmpty():
# add the currentEntity to the pendingEntities # add the currentEntity to the pendingEntities
if not self.victim.currentEntity in G.pendingEntities: if not self.victim.currentEntity in G.pendingEntities:
...@@ -132,8 +133,8 @@ class Broker(ObjectInterruption): ...@@ -132,8 +133,8 @@ class Broker(ObjectInterruption):
assert self.isCalled.value==self.env.now, 'the broker should be granted control instantly' assert self.isCalled.value==self.env.now, 'the broker should be granted control instantly'
self.isCalled=self.env.event() self.isCalled=self.env.event()
# The operator is released # The operator is released (the router is not called in the case of skilled ops that work constantly on the same machine)
if not self.victim.checkForSkilledOperators():
if not self.victim.isOperated(): if not self.victim.isOperated():
self.victim.currentOperator.totalWorkingTime+=self.env.now-self.victim.currentOperator.timeLastOperationStarted self.victim.currentOperator.totalWorkingTime+=self.env.now-self.victim.currentOperator.timeLastOperationStarted
# signal the other brokers waiting for the same operators that they are now free # signal the other brokers waiting for the same operators that they are now free
...@@ -144,7 +145,6 @@ class Broker(ObjectInterruption): ...@@ -144,7 +145,6 @@ class Broker(ObjectInterruption):
if not self.victim.router.invoked: if not self.victim.router.invoked:
self.victim.printTrace(self.victim.id, signal='router (broker)') self.victim.printTrace(self.victim.id, signal='router (broker)')
self.victim.router.invoked=True self.victim.router.invoked=True
# self.victim.router.isCalled.signal(now())
self.victim.router.isCalled.succeed(self.env.now) self.victim.router.isCalled.succeed(self.env.now)
# TODO: signalling the router will give the chance to it to take the control, but when will it eventually receive it. # TODO: signalling the router will give the chance to it to take the control, but when will it eventually receive it.
# after signalling the broker will signal it's victim that it has finished it's processes # after signalling the broker will signal it's victim that it has finished it's processes
......
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