Commit 24990469 authored by Ioannis Papagiannopoulos's avatar Ioannis Papagiannopoulos Committed by Georgios Dagkakis

objectInterruption methods reactive/interruptVictim request allocation from...

objectInterruption methods reactive/interruptVictim request allocation from Router if the victims have dedicatedOperator
parent 1266061a
......@@ -92,6 +92,10 @@ class ObjectInterruption(object):
# TODO: reconsider what happens when failure and ShiftScheduler (e.g.) signal simultaneously
self.victim.interruptedBy=self.type
self.victim.interruptionStart.succeed(self.env.now)
# if the machines are operated by dedicated operators
if self.victim.dedicatedOperator:
# request allocation
self.victim.requestAllocation()
#===========================================================================
# reactivate the victim
......@@ -102,6 +106,10 @@ class ObjectInterruption(object):
self.victim.interruptionStart=self.env.event()
# TODO: reconsider what happens when failure and ShiftScheduler (e.g.) signal simultaneously
self.victim.interruptedBy=None
# if the machines are operated by dedicated operators
if self.victim.dedicatedOperator:
# request allocation
self.victim.requestAllocation()
#===========================================================================
# outputs message to the trace.xls. Format is (Simulation Time | Victim Name | message)
......
......@@ -95,6 +95,7 @@ class ScheduledMaintenance(ObjectInterruption):
assert self.victimIsEmptyBeforeMaintenance.value==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()
self.victim.Up=False
self.victim.timeLastFailure=self.env.now
self.outputTrace("is down")
......
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