Commit 2ee7a623 authored by Ioannis Papagiannopoulos's avatar Ioannis Papagiannopoulos Committed by Georgios Dagkakis

shiftScheduler and ScheduledMaintenance make use of victims endLastProcessing...

shiftScheduler and ScheduledMaintenance make use of victims endLastProcessing signal instead of victimEndLastPorcessing which is now outdated
parent 71c2d4cd
...@@ -55,7 +55,7 @@ class ScheduledMaintenance(ObjectInterruption): ...@@ -55,7 +55,7 @@ class ScheduledMaintenance(ObjectInterruption):
# ======================================================================= # =======================================================================
def initialize(self): def initialize(self):
ObjectInterruption.initialize(self) ObjectInterruption.initialize(self)
self.victimEndedLastProcessing=self.env.event() # self.victimEndedLastProcessing=self.env.event()
self.waitingSignal=False self.waitingSignal=False
# not used yet # not used yet
self.victimIsEmptyBeforeMaintenance=self.env.event() self.victimIsEmptyBeforeMaintenance=self.env.event()
...@@ -81,11 +81,12 @@ class ScheduledMaintenance(ObjectInterruption): ...@@ -81,11 +81,12 @@ class ScheduledMaintenance(ObjectInterruption):
self.victim.isWorkingOnTheLast=True self.victim.isWorkingOnTheLast=True
self.waitingSignal=True self.waitingSignal=True
# TODO: signal to be triggered by postProcessingActions of Machines # TODO: signal to be triggered by postProcessingActions of Machines
yield self.victimEndedLastProcessing # there is no signal yet that signals the change of such state (an object getting empty) yield self.victim.endedLastProcessing # there is no signal yet that signals the change of such state (an object getting empty)
assert self.victimEndedLastProcessing.value==self.env.now, 'the processing end signal is not received by maintenance on time' assert self.victim.endedLastProcessing.value==self.env.now, 'the processing end signal is not received by maintenance on time'
self.victimEndedLastProcessing=self.env.event() self.victim.endedLastProcessing=self.env.event()
waitTime=self.env.now-waitStartTime waitTime=self.env.now-waitStartTime
self.interruptVictim() self.interruptVictim()
# XXX not yet used
elif self.endStatus=='emptied': elif self.endStatus=='emptied':
waitStartTime=self.env.now waitStartTime=self.env.now
self.waitingSignal=True self.waitingSignal=True
......
...@@ -53,7 +53,7 @@ class ShiftScheduler(ObjectInterruption): ...@@ -53,7 +53,7 @@ class ShiftScheduler(ObjectInterruption):
def initialize(self): def initialize(self):
ObjectInterruption.initialize(self) ObjectInterruption.initialize(self)
self.remainingShiftPattern=list(self.shiftPattern) self.remainingShiftPattern=list(self.shiftPattern)
self.victimEndedLastProcessing=self.env.event() # self.victimEndedLastProcessing=self.env.event()
self.waitingSignal=False self.waitingSignal=False
# ======================================================================= # =======================================================================
...@@ -87,8 +87,8 @@ class ShiftScheduler(ObjectInterruption): ...@@ -87,8 +87,8 @@ class ShiftScheduler(ObjectInterruption):
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.isWorkingOnTheLast=True self.victim.isWorkingOnTheLast=True
self.waitingSignal=True self.waitingSignal=True
yield self.victimEndedLastProcessing yield self.victim.endedLastProcessing
self.victimEndedLastProcessing=self.env.event() self.victim.endedLastProcessing=self.env.event()
self.interruptVictim() # interrupt processing operations if any self.interruptVictim() # interrupt processing operations if any
self.victim.onShift=False # get the victim off-shift self.victim.onShift=False # get the victim off-shift
......
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