Commit a00cced5 authored by Georgios Dagkakis's avatar Georgios Dagkakis Committed by Jérome Perrin

machine internal method ifCanDisposeOrHaveFailure updated to a more generic...

machine internal method ifCanDisposeOrHaveFailure updated to a more generic version. This way MachineJobShop also does not have to override it
parent 1d915283
...@@ -279,9 +279,9 @@ class Machine(CoreObject): ...@@ -279,9 +279,9 @@ class Machine(CoreObject):
# ======================================================================= # =======================================================================
# checks if the machine down or it can dispose the object # 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):
# the last part is added so that it is not removed and stack gotta think of it again return self.Up==False or self.getReceiverObject().canAccept(self) or len(self.getActiveObjectQueue())==0
return self.Up==False or self.next[0].canAccept(self) or len(self.Res.activeQ)==0
# ======================================================================= # =======================================================================
# removes an entity from the Machine # removes an entity from the Machine
......
...@@ -40,11 +40,7 @@ class MachineJobShop(Machine): ...@@ -40,11 +40,7 @@ class MachineJobShop(Machine):
self.nextStationId=avtiveEntity.remainingRoute[1][0] #read the next station id self.nextStationId=avtiveEntity.remainingRoute[1][0] #read the next station id
avtiveEntity.remainingRoute.pop(0) #remove data from the remaining route of the entity avtiveEntity.remainingRoute.pop(0) #remove data from the remaining route of the entity
return avtiveEntity return avtiveEntity
#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
#calculates the processing time #calculates the processing time
def calculateProcessingTime(self): def calculateProcessingTime(self):
return self.procTime #this is the processing time for this unique entity return self.procTime #this is the processing time for this unique entity
......
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