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

comments added

parent 3869c130
...@@ -528,13 +528,17 @@ class Machine(CoreObject): ...@@ -528,13 +528,17 @@ class Machine(CoreObject):
self.completedJobs+=1 # Machine completed one more Job self.completedJobs+=1 # Machine completed one more Job
# reseting the shouldPreempt flag # reseting the shouldPreempt flag
self.shouldPreempt=False self.shouldPreempt=False
# in case Machine just performed the last work before end of shift it should signal the ShiftScheduler
if self.isWorkingOnTheLastBeforeOffShift: if self.isWorkingOnTheLastBeforeOffShift:
# find the ShiftSchedulerList
mySS=None mySS=None
for SS in G.ShiftSchedulerList: for SS in G.ShiftSchedulerList:
if SS.victim==self: if SS.victim==self:
mySS=SS mySS=SS
break break
# set the signal
mySS.victimEndedLastProcessing.succeed() mySS.victimEndedLastProcessing.succeed()
# reset the flag
self.isWorkingOnTheLastBeforeOffShift=False self.isWorkingOnTheLastBeforeOffShift=False
# ======================================================================= # =======================================================================
......
...@@ -84,6 +84,8 @@ class ShiftScheduler(ObjectInterruption): ...@@ -84,6 +84,8 @@ class ShiftScheduler(ObjectInterruption):
startShift=self.env.now startShift=self.env.now
else: else:
yield self.env.timeout(float(self.remainingShiftPattern[0][1]-self.env.now)) # wait until the shift is over yield self.env.timeout(float(self.remainingShiftPattern[0][1]-self.env.now)) # wait until the shift is over
# if the mode is to end current work before going off-shift and there is current work, wait for victimEndedLastProcessing
# signal before going off-shift
if self.endUnfinished and len(self.victim.getActiveObjectQueue())==1 and (not self.victim.waitToDispose): if self.endUnfinished and len(self.victim.getActiveObjectQueue())==1 and (not self.victim.waitToDispose):
self.victim.isWorkingOnTheLastBeforeOffShift=True self.victim.isWorkingOnTheLastBeforeOffShift=True
yield self.victimEndedLastProcessing yield self.victimEndedLastProcessing
......
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