clean in operators and machines

parent 50838599
......@@ -638,15 +638,6 @@ class Machine(CoreObject):
# has to block the predecessor giverObject to avoid conflicts with other competing machines
if (activeObject.operatorPool!='None' and (any(type=='Load' for type in activeObject.multOperationTypeList))):
if giverObject.haveToDispose(activeObject):
#===============================================================
# # TODO: check whether this entity is the one to be hand in
# # to be used in operatorPreemptive
# activeObject.requestingEntity=giverObject.getActiveObjectQueue()[0]
# # TODO: update the objects requesting the operator
# activeObject.operatorPool.requestingObject=activeObject.giver
# # TODOD: update the last object calling the operatorPool
# activeObject.operatorPool.receivingObject=activeObject
#===============================================================
if activeObject.checkOperator()\
and activeObject.checkIfActive() and len(activeObjectQueue)<activeObject.capacity:
if not giverObject.exitIsAssignedTo():
......@@ -699,12 +690,6 @@ class Machine(CoreObject):
else:
return True
# # =======================================================================
# # checks if the machine down or it can dispose the object
# # =======================================================================
# def ifCanDisposeOrHaveFailure(self):
# return self.Up==False or self.getReceiverObject().canAccept(self) or len(self.getActiveObjectQueue())==0
# =======================================================================
# get an entity from the giver
# =======================================================================
......
......@@ -117,15 +117,6 @@ class MachineManagedJob(MachineJobShop):
if (activeObject.operatorPool!='None' and (any(type=='Load' for type in activeObject.multOperationTypeList)\
or any(type=='Setup' for type in activeObject.multOperationTypeList))):
if giverObject.haveToDispose(activeObject):
#===============================================================
# # TODO: check whether this entity is the one to be hand in
# # to be used in operatorPreemptive
# activeObject.requestingEntity=activeObject.giver.getActiveObjectQueue()[0]
# # TODO: update the object requesting the operator
# activeObject.operatorPool.requestingObject=activeObject.giver
# # TODO: update the last object calling the operatorPool
# activeObject.operatorPool.receivingObject=activeObject
#===============================================================
if activeObject.checkIfActive() and len(activeObjectQueue)<activeObject.capacity\
and activeObject.checkOperator(giverObject):
if not giverObject.exitIsAssignedTo():
......@@ -144,33 +135,12 @@ class MachineManagedJob(MachineJobShop):
# if the multOperationTypeList contains only Processing
elif (activeObject.operatorPool!='None' and any(type=='Processing' for type in activeObject.multOperationTypeList)):
if giverObject.haveToDispose(activeObject):
#===============================================================
# # TODO: check whether this entity is the one to be hand in
# # to be used in operatorPreemptive
# activeObject.requestingEntity=activeObject.giver.getActiveObjectQueue()[0]
# # TODO: update the object requesting the operator
# activeObject.operatorPool.requestingObject=activeObject.giver
# # TODO: update the last object calling the operatorPool
# activeObject.operatorPool.receivingObject=activeObject
#===============================================================
# TODO: the operator must not be available for the object to receive the entity
# the operator must not be available for the object to receive the entity
# the exit of the giver should not be assigned
# the manager must not be available for the entity to be delivered
# the machine can be appended to the activeCallersList of the manager
# there may be a problem with the activeCallersList as the Router may assign
# the operator to the machine while he is not needed for receiving the entity
# the entityToGet should be updated
if activeObject.checkIfActive() and len(activeObjectQueue)<activeObject.capacity:#\
# and self.checkOperator()\
# and not activeObject.giver.exitIsAssignedTo():
# activeObject.giver.assignExitTo()
# # if the activeObject is not in manager's activeCallersList of the entityToGet
# if self not in activeObject.giver.getActiveObjectQueue()[0].manager.activeCallersList:
# # append it to the activeCallerList of the manager of the entity to be received
# activeObject.giver.getActiveObjectQueue()[0].manager.activeCallersList.append(self)
# # update entityToGet
# self.entityToGet=activeObject.giver.getActiveObjectQueue()[0]
if activeObject.checkIfActive() and len(activeObjectQueue)<activeObject.capacity:
# the entityToGet should be updated
activeObject.entityToGet=giverObjectQueue[0]
#make the operators List so that it holds only the manager of the current order
activeObject.operatorPool.operators=[giverObjectQueue[0].manager]
......
......@@ -114,7 +114,6 @@ class Broker(ObjectInterruption):
# ======= release a resource
elif not self.victim.isOperated():
self.victim.currentOperator.totalWorkingTime+=now()-self.victim.currentOperator.timeLastOperationStarted
# self.victim.outputTrace(self.victim.currentOperator.objName, "left "+ self.victim.objName)
yield release,self,self.victim.operatorPool.getResource(self.victim.currentOperator)
# signal the other brokers waiting for the same operators that they are now free
# also signal the stations that were not requested to receive because the operator was occupied
......@@ -128,7 +127,6 @@ class Broker(ObjectInterruption):
# 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
# TODO: this wont work for the moment. The actions that follow must be performed by all operated brokers.
# self.signalLoadStations()
self.printTrace(self.victim.currentOperator.objName, 'released '+self.victim.id)
# the victim current operator must be cleared after the operator is released
......
......@@ -67,25 +67,6 @@ class OperatorManagedJob(Operator):
# return False
return len(self.Res.activeQ)<self.capacity
# #===========================================================================
# # assign an operator
# #===========================================================================
# def assignTo(self, callerObject=None):
# assert callerObject!=None, 'the operator cannot be assigned to None'
# self.operatorAssignedTo=callerObject
#
# #===========================================================================
# # un-assign an operator
# #===========================================================================
# def unAssign(self):
# self.operatorAssignedTo=None
#
# #===========================================================================
# # check whether the operator is assigned
# #===========================================================================
# def isAssignedTo(self):
# return self.operatorAssignedTo
#===========================================================================
# check if the operator has only one station as candidate option
#===========================================================================
......
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