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):
self.completedJobs+=1 # Machine completed one more Job
# reseting the shouldPreempt flag
self.shouldPreempt=False
# in case Machine just performed the last work before end of shift it should signal the ShiftScheduler
if self.isWorkingOnTheLastBeforeOffShift:
# find the ShiftSchedulerList
mySS=None
for SS in G.ShiftSchedulerList:
if SS.victim==self:
mySS=SS
break
# set the signal
mySS.victimEndedLastProcessing.succeed()
# reset the flag
self.isWorkingOnTheLastBeforeOffShift=False
# =======================================================================
......
......@@ -84,6 +84,8 @@ class ShiftScheduler(ObjectInterruption):
startShift=self.env.now
else:
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):
self.victim.isWorkingOnTheLastBeforeOffShift=True
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