entityToGet updated also when operationType is only Processing

parent fcf1f2e8
......@@ -132,7 +132,7 @@ class MachineManagedJob(MachineJobShop):
if(timeWaiting>=maxTimeWaiting):
activeObject.giver=object # set the giver
maxTimeWaiting=timeWaiting
# if the multOperationTypeList of the machine contains Load or Setup
if (activeObject.operatorPool!='None' and (any(type=='Load' for type in activeObject.multOperationTypeList)\
or any(type=='Setup' for type in activeObject.multOperationTypeList))):
if isRequested:
......@@ -168,6 +168,52 @@ class MachineManagedJob(MachineJobShop):
# if entity not in self.entitiesToGet:
# self.entitiesToGet.append(entity)
# # activeObject.giver.assignExit()
# return True
else:
return False
# if the multOperationTypeList contains only Processing
elif (activeObject.operatorPool!='None' and any(type=='Processing' for type in activeObject.multOperationTypeList)):
if isRequested:
# 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 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.Up and len(activeObjectQueue)<activeObject.capacity:#\
# and self.checkOperator()\
# and not activeObject.giver.exitIsAssigned():
# activeObject.giver.assignExit()
# # 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]
self.entityToGet=activeObject.giver.getActiveObjectQueue()[0]
#make the operators List so that it holds only the manager of the current order
activeObject.operatorPool.operators=[activeObject.giver.getActiveObjectQueue()[0].manager]
# read the load time of the machine
self.readLoadTime()
return True
# if activeObject.Up and len(activeObjectQueue)<activeObject.capacity:
# if not activeObject.giver.exitIsAssigned():
# for entity in activeObject.giver.getActiveObjectQueue():
# if activeObject.checkOperator(entity):
# if self not in entity.manager.activeCallersList:
# entity.manager.activeCallersList.append(self)
# if entity not in self.entitiesToGet:
# self.entitiesToGet.append(entity)
# # activeObject.giver.assignExit()
# return True
else:
return False
......
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