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