Commit 18769d8d authored by Georgios Dagkakis's avatar Georgios Dagkakis Committed by Jérome Perrin

additions so that the movements of the operator are outputted in the Trace

parent 8a6b0745
...@@ -626,6 +626,7 @@ class Machine(CoreObject): ...@@ -626,6 +626,7 @@ class Machine(CoreObject):
# prepare the machine to be released # prepare the machine to be released
# ======================================================================= # =======================================================================
def releaseOperator(self): def releaseOperator(self):
self.outputTrace(self.currentOperator.objName, "released from "+ self.objName)
self.broker.invokeBroker() self.broker.invokeBroker()
self.toBeOperated = False self.toBeOperated = False
......
...@@ -74,12 +74,12 @@ class Broker(ObjectInterruption): ...@@ -74,12 +74,12 @@ class Broker(ObjectInterruption):
self.timeWaitForOperatorStarted = 0 self.timeWaitForOperatorStarted = 0
# update the time that the operation started # update the time that the operation started
self.timeOperationStarted = now() self.timeOperationStarted = now()
#self.victim.outputTrace(self.victim.currentOperator.objName, "started work "+self.victim.objName) self.victim.outputTrace(self.victim.currentOperator.objName, "started work in "+ self.victim.objName)
self.victim.currentOperator.timeLastOperationStarted=now() self.victim.currentOperator.timeLastOperationStarted=now()
# ======= 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
#self.victim.outputTrace(self.victim.currentOperator.objName, "finished work "+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
self.timeLastOperationEnded = now() self.timeLastOperationEnded = now()
......
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