Commit e66d1a02 authored by Ioannis Papagiannopoulos's avatar Ioannis Papagiannopoulos Committed by Georgios Dagkakis

endProcessingActions removed from MachineJobShop

parent 29f57b4b
...@@ -72,68 +72,68 @@ class MachineJobShop(Machine): ...@@ -72,68 +72,68 @@ class MachineJobShop(Machine):
self.next=[] self.next=[]
Machine.initialize(self) #run default behaviour Machine.initialize(self) #run default behaviour
# ======================================================================= # # =======================================================================
# actions to be carried out when the processing of an Entity ends # # actions to be carried out when the processing of an Entity ends
# ======================================================================= # # =======================================================================
def endProcessingActions(self): # def endProcessingActions(self):
# set isProcessing to False # # set isProcessing to False
self.isProcessing=False # self.isProcessing=False
# add working time # # add working time
self.totalWorkingTime+=self.env.now-self.timeLastProcessingStarted # self.totalWorkingTime+=self.env.now-self.timeLastProcessingStarted
#
# blocking starts # # blocking starts
self.isBlocked=True # self.isBlocked=True
self.timeLastBlockageStarted=self.env.now # self.timeLastBlockageStarted=self.env.now
#
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:
activeObject.outputTrace(activeEntity.name,"ended processing in "+activeObject.objName) # activeObject.outputTrace(activeEntity.name,"ended processing in "+activeObject.objName)
except IndexError: # except IndexError:
pass # pass
#
import Globals # import Globals
from Globals import G # from Globals import G
# the entity that just got processed is cold again it will get # # the entity that just got processed is cold again it will get
# hot again by the time it reaches the giver of the next machine # # hot again by the time it reaches the giver of the next machine
# TODO: Not only Machines require time to process entities # # TODO: Not only Machines require time to process entities
if activeEntity.family=='Job': # if activeEntity.family=='Job':
# read the list of next stations for the entity in just finished processing # # read the list of next stations for the entity in just finished processing
nextObjectIds=activeEntity.remainingRoute[0].get('stationIdsList',[]) # nextObjectIds=activeEntity.remainingRoute[0].get('stationIdsList',[])
nextObjects = [] # nextObjects = []
for nextObjectId in nextObjectIds: # for nextObjectId in nextObjectIds:
nextObject=Globals.findObjectById(nextObjectId) # nextObject=Globals.findObjectById(nextObjectId)
nextObjects.append(nextObject) # nextObjects.append(nextObject)
successorsAreMachines=True # successorsAreMachines=True
for object in nextObjects: # for object in nextObjects:
if not object in G.MachineList: # if not object in G.MachineList:
successorsAreMachines=False # successorsAreMachines=False
break # break
if not successorsAreMachines: # if not successorsAreMachines:
activeObjectQueue[0].hot = False # activeObjectQueue[0].hot = False
# the just processed entity is added to the list of entities # # the just processed entity is added to the list of entities
# pending for the next processing # # pending for the next processing
G.pendingEntities.append(activeObjectQueue[0]) # G.pendingEntities.append(activeObjectQueue[0])
# set the variable that flags an Entity is ready to be disposed # # set the variable that flags an Entity is ready to be disposed
activeObject.waitToDispose=True # activeObject.waitToDispose=True
#do this so that if it is overtime working it is not counted as off-shift time # #do this so that if it is overtime working it is not counted as off-shift time
if not activeObject.onShift: # if not activeObject.onShift:
activeObject.timeLastShiftEnded=self.env.now # activeObject.timeLastShiftEnded=self.env.now
# 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
activeObject.completedJobs+=1 # Machine completed one more Job # activeObject.completedJobs+=1 # Machine completed one more Job
# reset flags # # reset flags
self.shouldPreempt=False # self.shouldPreempt=False
self.isProcessingInitialWIP=False # self.isProcessingInitialWIP=False
#
# TODO: collapse that to Machine # # TODO: collapse that to 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