Commit 0f903888 authored by Ioannis Papagiannopoulos's avatar Ioannis Papagiannopoulos Committed by Jérome Perrin

canAccept and canAcceptAndIsRequested methods of Machine object and those...

canAccept and canAcceptAndIsRequested methods of Machine object and those inheriting from it updated, so that they can check of operators availability in case of Setup operationType
parent 2876e3e2
......@@ -414,7 +414,7 @@ class Machine(CoreObject):
# this is done to achieve better (cpu) processing time
# then we can also use it as a filter for a yield method
if(len(activeObject.previous)==1 or callerObject==None):
if (activeObject.operatorPool!='None' and any(type=='Load' for type in activeObject.multOperationTypeList)):
if (activeObject.operatorPool!='None' and any(type=='Load' or 'Setup' for type in activeObject.multOperationTypeList)):
return activeObject.operatorPool.checkIfResourceIsAvailable()\
and activeObject.Up\
and len(activeObjectQueue)<activeObject.capacity
......@@ -424,7 +424,7 @@ class Machine(CoreObject):
thecaller=callerObject
# return True ONLY if the length of the activeOjbectQue is smaller than
# the object capacity, and the callerObject is not None but the giverObject
if (activeObject.operatorPool!='None' and any(type=='Load' for type in activeObject.multOperationTypeList)):
if (activeObject.operatorPool!='None' and any(type=='Load' or 'Setup' for type in activeObject.multOperationTypeList)):
return activeObject.operatorPool.checkIfResourceIsAvailable()\
and activeObject.Up\
and len(activeObjectQueue)<activeObject.capacity
......@@ -454,7 +454,7 @@ class Machine(CoreObject):
# if not then the machine has to block the predecessor giverObject to avoid conflicts
# with other competing machines
if(len(activeObject.previous)==1):
if (activeObject.operatorPool!='None' and any(type=='Load' for type in activeObject.multOperationTypeList)):
if (activeObject.operatorPool!='None' and any(type=='Load' or 'Setup' for type in activeObject.multOperationTypeList)):
if activeObject.operatorPool.checkIfResourceIsAvailable()\
and activeObject.Up and len(activeObjectQueue)<activeObject.capacity\
and giverObject.haveToDispose(activeObject) and not giverObject.exitIsAssigned():
......@@ -494,7 +494,7 @@ class Machine(CoreObject):
activeObject.giver=object # set the giver
maxTimeWaiting=timeWaiting
if (activeObject.operatorPool!='None' and any(type=='Load' for type in activeObject.multOperationTypeList)):
if (activeObject.operatorPool!='None' and any(type=='Load' or 'Setup' for type in activeObject.multOperationTypeList)):
if activeObject.operatorPool.checkIfResourceIsAvailable()\
and activeObject.Up and len(activeObjectQueue)<activeObject.capacity\
and isRequested and not activeObject.giver.exitIsAssigned():
......
......@@ -89,7 +89,7 @@ class MachineJobShop(Machine):
if activeObject.id in activeEntity.remainingRoute[0].get('stationIdsList',[]):
#return according to the state of the Queue
# also check if (if the machine is to be operated) there are available operators
if (activeObject.operatorPool!='None' and any(type=='Load' for type in activeObject.multOperationTypeList)):
if (activeObject.operatorPool!='None' and any(type=='Load' or 'Setup' for type in activeObject.multOperationTypeList)):
return activeObject.operatorPool.checkIfResourceIsAvailable()\
and len(activeObject.getActiveObjectQueue())<activeObject.capacity\
and activeObject.Up
......
......@@ -294,7 +294,7 @@ class MouldAssembly(MachinePreemptive):
if activeObject.id in activeEntity.remainingRoute[0].get('stationIdsList',[]):
#return according to the state of the Queue
# check if (if the machine is to be operated) there are available operators
if (activeObject.operatorPool!='None' and any(type=='Load' for type in activeObject.multOperationTypeList)):
if (activeObject.operatorPool!='None' and any(type=='Load' or 'Setup' for type in activeObject.multOperationTypeList)):
return activeObject.operatorPool.checkIfResourceIsAvailable()\
and len(activeObject.getActiveObjectQueue())==0\
and activeObject.Up
......
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