Commit 3bafbca0 authored by Ioannis Papagiannopoulos's avatar Ioannis Papagiannopoulos Committed by Jérome Perrin

getEntity of MachinePreemptive collapsed to CoreObject

parent 936f288a
...@@ -97,7 +97,9 @@ class CoreObject(Process): ...@@ -97,7 +97,9 @@ class CoreObject(Process):
self.failureTimeInCurrentEntity=0 self.failureTimeInCurrentEntity=0
self.setupTimeCurrentEntity=0 self.setupTimeCurrentEntity=0
self.shouldPreempt=False #flag that shows that the machine should preempt or not self.shouldPreempt=False #flag that shows that the machine should preempt or not
self.lastGiver=None # variable that holds the last giver of the object, used by machine in case of preemption
# ======================================================================= # =======================================================================
# the main process of the core object # the main process of the core object
...@@ -155,7 +157,8 @@ class CoreObject(Process): ...@@ -155,7 +157,8 @@ class CoreObject(Process):
activeObjectQueue=self.getActiveObjectQueue() activeObjectQueue=self.getActiveObjectQueue()
# remove entity from the giver # remove entity from the giver
activeEntity = giverObject.removeEntity() activeEntity = giverObject.removeEntity()
# variable that holds the last giver; used in case of preemption
self.lastGiver=self.giver
#get the entity from the previous object and put it in front of the activeQ #get the entity from the previous object and put it in front of the activeQ
activeObjectQueue.append(activeEntity) activeObjectQueue.append(activeEntity)
# if the giverObject is blocked then unBlock it # if the giverObject is blocked then unBlock it
......
...@@ -45,10 +45,10 @@ class MachinePreemptive(MachineJobShop): ...@@ -45,10 +45,10 @@ class MachinePreemptive(MachineJobShop):
setupDistribution,setupMean, setupStdev, setupMin, setupMax) setupDistribution,setupMean, setupStdev, setupMin, setupMax)
self.resetOnPreemption=resetOnPreemption #flag that shows if the processing time should be reset or not self.resetOnPreemption=resetOnPreemption #flag that shows if the processing time should be reset or not
def getEntity(self): # def getEntity(self):
activeEntity=MachineJobShop.getEntity(self) # activeEntity=MachineJobShop.getEntity(self)
self.lastGiver=self.giver # self.lastGiver=self.giver
return activeEntity # return activeEntity
# ======================================================================= # =======================================================================
# method to execute the preemption # method to execute the preemption
......
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