Commit dac39ecb authored by Georgios Dagkakis's avatar Georgios Dagkakis

MachineJobShop to count processing time in new style

parent b0dbe2bc
...@@ -45,12 +45,14 @@ class MachineJobShop(Machine): ...@@ -45,12 +45,14 @@ class MachineJobShop(Machine):
# ======================================================================= # =======================================================================
def endProcessingActions(self): def endProcessingActions(self):
self.isProcessing=False self.isProcessing=False
self.totalWorkingTime+=self.env.now-self.timeLastProcessingStarted
activeObject=self.getActiveObject() activeObject=self.getActiveObject()
activeObjectQueue=activeObject.Res.users activeObjectQueue=activeObject.Res.users
activeEntity=activeObjectQueue[0] activeEntity=activeObjectQueue[0]
# self.printTrace(activeEntity.name,processEnd=activeObject.objName) # self.printTrace(activeEntity.name,processEnd=activeObject.objName)
# reset the variables used to handle the interruptions timing # reset the variables used to handle the interruptions timing
self.timeRestartingProcessing=0 # self.timeRestartingProcessing=0
self.breakTime=0 self.breakTime=0
# output to trace that the processing in the Machine self.objName ended # output to trace that the processing in the Machine self.objName ended
try: try:
...@@ -86,10 +88,10 @@ class MachineJobShop(Machine): ...@@ -86,10 +88,10 @@ class MachineJobShop(Machine):
if not activeObject.onShift: if not activeObject.onShift:
activeObject.timeLastShiftEnded=self.env.now activeObject.timeLastShiftEnded=self.env.now
# update the total working time # the total processing time for this entity is what the distribution initially gave # update the total working time # the total processing time for this entity is what the distribution initially gave
if not self.shouldPreempt: # if not self.shouldPreempt:
activeObject.totalWorkingTime+=activeObject.totalProcessingTimeInCurrentEntity # activeObject.totalWorkingTime+=activeObject.totalProcessingTimeInCurrentEntity
else: # else:
activeObject.totalWorkingTime+=self.env.now-(self.timeLastEntityEntered) # activeObject.totalWorkingTime+=self.env.now-(self.timeLastEntityEntered)
# update the variables keeping track of Entity related attributes of the machine # update the variables keeping track of Entity related attributes of the machine
activeObject.timeLastEntityEnded=self.env.now # this holds the time that the last entity ended processing in Machine activeObject.timeLastEntityEnded=self.env.now # this holds the time that the last entity ended processing in Machine
activeObject.nameLastEntityEnded=activeObject.currentEntity.name # this holds the name of the last entity that ended processing in Machine activeObject.nameLastEntityEnded=activeObject.currentEntity.name # this holds the name of the last entity that ended processing in Machine
......
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