Commit 65ef1727 authored by Georgios Dagkakis's avatar Georgios Dagkakis Committed by Sebastien Robin

small enhancement in Machine canAcceptAndIsRequested

parent a7dd93ec
...@@ -224,7 +224,7 @@ class Machine(CoreObject): ...@@ -224,7 +224,7 @@ class Machine(CoreObject):
#if we have only one predecessor just check if there is a place, the machine is up and the predecessor has an entity to dispose #if we have only one predecessor just check if there is a place, the machine is up and the predecessor has an entity to dispose
if(len(activeObject.previous)==1): if(len(activeObject.previous)==1):
return activeObject.Up and len(activeObjectQueue)==0 and giverObject.haveToDispose(activeObject) return activeObject.Up and len(activeObjectQueue)<activeObject.capacity and giverObject.haveToDispose(activeObject)
isRequested=False isRequested=False
maxTimeWaiting=0 maxTimeWaiting=0
...@@ -244,7 +244,7 @@ class Machine(CoreObject): ...@@ -244,7 +244,7 @@ class Machine(CoreObject):
activeObject.predecessorIndex=i activeObject.predecessorIndex=i
maxTimeWaiting=timeWaiting maxTimeWaiting=timeWaiting
i+=1 i+=1
return len(activeObjectQueue)<activeObject.capacity and isRequested return len(activeObjectQueue)<activeObject.capacity and isRequested and activeObject.Up
#checks if the machine down or it can dispose the object #checks if the machine down or it can dispose the object
def ifCanDisposeOrHaveFailure(self): def ifCanDisposeOrHaveFailure(self):
......
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