Commit 015f2752 authored by Georgios Dagkakis's avatar Georgios Dagkakis Committed by Jérome Perrin

main script changed so that Operators also output results

parent 0fd23e97
......@@ -169,5 +169,4 @@ def setWIP(entityList):
entity.remainingRoute.pop(0) # remove data from the remaining route.
entity.schedule.append([object,now()]) #append the time to schedule so that it can be read in the result
entity.currentStation=object # update the current station of the entity
......@@ -201,7 +201,7 @@ def createObjects():
O.coreObjectIds=getSuccessorList(id) # update the list of objects that the operator operates
# calling the getSuccesorList() method on the operator
G.OperatorsList.append(O) # add the operator to the RepairmanList
#G.ModelResourceList.append(O)
G.ModelResourceList.append(O)
# -----------------------------------------------------------------------
# loop through all the model resources
# search for operatorPools in order to create them
......
......@@ -86,7 +86,6 @@ class Machine(CoreObject):
else:
self.operatorPool='None'
#self.operatorPool=operatorPool
#print operatorPool
# update the operatorPool coreObjects list
if self.operatorPool!='None':
self.operatorPool.coreObjectIds.append(self.id)
......@@ -181,8 +180,7 @@ class Machine(CoreObject):
while 1:
# wait until the machine can accept an entity and one predecessor requests it
# canAcceptAndIsRequested is invoked to check when the machine requested to receive an entity
yield waituntil, self, self.canAcceptAndIsRequested
yield waituntil, self, self.canAcceptAndIsRequested
# here or in the get entity (apart from the loatTimeCurrentEntity)
# in case they are placed inside the getEntity then the initialize of
# the corresponding variables should be moved to the initialize() of the CoreObject
......@@ -272,7 +270,6 @@ class Machine(CoreObject):
# after getting the entity release the operator
# machine has to release the operator
self.releaseOperator()
# print self.objName, 'operator released', now()
# wait until the Broker has finished processing
yield waituntil, self, self.broker.brokerIsSet
......@@ -319,7 +316,6 @@ class Machine(CoreObject):
and self.isOperated()\
and any(type=="Processing" for type in self.multOperationTypeList):
self.releaseOperator()
# print self.objName, 'operator released due to failure', now()
yield waituntil,self,self.broker.brokerIsSet
# if there is a failure in the machine it is passivated
......
......@@ -80,8 +80,9 @@ class Broker(ObjectInterruption):
self.victim.currentOperator.totalWorkingTime+=now()-self.victim.currentOperator.timeLastOperationStarted
yield release,self,self.victim.operatorPool.getResource(self.victim.currentOperator)
# the victim current operator must be cleared after the operator is released
self.victim.currentOperator = None
self.timeLastOperationEnded = now()
self.victim.currentOperator.totalWorkingTime+=self.timeLastOperationEnded-self.timeOperationStarted
self.victim.currentOperator = None
else:
pass
# return the control the machine.run
......
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