Commit 245ef0ee authored by Ioannis Papagiannopoulos's avatar Ioannis Papagiannopoulos Committed by Georgios Dagkakis

interruption objects updated for the new type of signalling

parent f05ce07f
......@@ -83,7 +83,8 @@ class ScheduledMaintenance(ObjectInterruption):
self.waitingSignal=True
# TODO: signal to be triggered by postProcessingActions of Machines
yield self.victim.endedLastProcessing # there is no signal yet that signals the change of such state (an object getting empty)
assert self.victim.endedLastProcessing.value==self.env.now, 'the processing end signal is not received by maintenance on time'
transmitter, eventTime=self.victim.endedLastProcessing.value
assert eventTime==self.env.now, 'the processing end signal is not received by maintenance on time'
self.victim.endedLastProcessing=self.env.event()
waitTime=self.env.now-waitStartTime
self.interruptVictim()
......@@ -93,7 +94,8 @@ class ScheduledMaintenance(ObjectInterruption):
self.waitingSignal=True
# TODO: signal to be triggered by removeEntity of Machines
yield self.victimIsEmptyBeforeMaintenance # there is no signal yet that signals the change of such state (an object getting empty)
assert self.victimIsEmptyBeforeMaintenance.value==self.env.now, 'the processing end signal is not received by maintenance on time'
transmitter, eventTime=self.victimIsEmptyBeforeMaintenance.value
assert eventTime==self.env.now, 'the processing end signal is not received by maintenance on time'
self.victimIsEmptyBeforeMaintenance=self.env.event()
waitTime=self.env.now-waitStartTime
self.interruptVictim()
......
......@@ -78,7 +78,8 @@ class ShiftScheduler(ObjectInterruption):
# if the victim has interruptions that measure only the on-shift time, they have to be notified
for oi in self.victim.objectInterruptions:
if oi.isWaitingForVictimOnShift:
oi.victimOnShift.succeed()
succeedTuple=(self,self.env.now)
oi.victimOnShift.succeed(succeedTuple)
self.victim.totalOffShiftTime+=self.env.now-self.victim.timeLastShiftEnded
self.victim.onShift=True
......@@ -96,13 +97,15 @@ class ShiftScheduler(ObjectInterruption):
if self.endUnfinished and len(self.victim.getActiveObjectQueue())==1 and (not self.victim.waitToDispose):
self.victim.isWorkingOnTheLast=True
self.waitingSignal=True
yield self.victim.endedLastProcessing
yield self.victim.endedLastProcessing
transmitter, eventTime=self.victim.endedLastProcessing.value
self.victim.endedLastProcessing=self.env.event()
# if the victim has interruptions that measure only the on-shift time, they have to be notified
for oi in self.victim.objectInterruptions:
if oi.isWaitingForVictimOffShift:
oi.victimOffShift.succeed()
succeedTuple=(self, self.env.now)
oi.victimOffShift.succeed(succeedTuple)
# interrupt the victim only if it was not previously interrupted
if not self.victim.interruptionStart.triggered:
......
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