minor correction to OperatedPoolBroker

parent 2e2a66be
...@@ -81,12 +81,14 @@ class Broker(ObjectInterruption): ...@@ -81,12 +81,14 @@ class Broker(ObjectInterruption):
# ======= release a resource # ======= release a resource
elif not self.victim.isOperated(): elif not self.victim.isOperated():
self.victim.currentOperator.totalWorkingTime+=now()-self.victim.currentOperator.timeLastOperationStarted self.victim.currentOperator.totalWorkingTime+=now()-self.victim.currentOperator.timeLastOperationStarted
# if the following object is not of type Machine # if the victim releasing the operator has receiver
if self.victim.receiver.type!='Machine': if self.victim.receiver:
# if the processingType is 'Processing' and not only 'Load' or 'Setup' # if the following object is not of type Machine
if any(type=='Processing' for type in self.victim.multOperationTypeList): if self.victim.receiver.type!='Machine':
# wait until the victim has released the entity it was processing # if the processingType is 'Processing' and not only 'Load' or 'Setup'
yield waituntil, self, self.victim.activeQueueIsEmpty if any(type=='Processing' for type in self.victim.multOperationTypeList):
# wait until the victim has released the entity it was processing
yield waituntil, self, self.victim.activeQueueIsEmpty
#self.victim.outputTrace(self.victim.currentOperator.objName, "left "+ self.victim.objName) #self.victim.outputTrace(self.victim.currentOperator.objName, "left "+ self.victim.objName)
yield release,self,self.victim.operatorPool.getResource(self.victim.currentOperator) yield release,self,self.victim.operatorPool.getResource(self.victim.currentOperator)
# the victim current operator must be cleared after the operator is released # the victim current operator must be cleared after the operator is released
......
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