Commit 0302f672 authored by Georgios Dagkakis's avatar Georgios Dagkakis

better definition of objectInterruptions

parent 6f1d262a
......@@ -285,7 +285,6 @@ def createObjectInterruptions():
duration=float(scheduledMaintenance.get('duration', 1))
victim=Globals.findObjectById(element['id'])
SM=ScheduledMaintenance(victim=victim, start=start, duration=duration)
victim.objectInterruptions.append(SM)
G.ObjectInterruptionList.append(SM)
G.ScheduledMaintenanceList.append(SM)
failure=element.get('failures', None)
......@@ -299,7 +298,6 @@ def createObjectInterruptions():
victim=Globals.findObjectById(element['id'])
deteriorationType=failure.get('deteriorationType', 'constant')
F=Failure(victim, distribution=failure, repairman=victim.repairman, deteriorationType=deteriorationType)
victim.objectInterruptions.append(F)
G.ObjectInterruptionList.append(F)
G.FailureList.append(F)
# if there is a shift pattern defined
......@@ -321,7 +319,6 @@ def createObjectInterruptions():
receiveBeforeEndThreshold=float(shift.get('receiveBeforeEndThreshold', 0))
SS=ShiftScheduler(victim, shiftPattern=shiftPattern, endUnfinished=endUnfinished,
receiveBeforeEndThreshold=receiveBeforeEndThreshold)
victim.objectInterruptions.append(SS)
G.ObjectInterruptionList.append(SS)
G.ShiftSchedulerList.append(SS)
......
......@@ -40,6 +40,10 @@ class ObjectInterruption(object):
self.call=False
from Globals import G
# G.ObjectInterruptionList.append(self)
# append the interruption to the list that victim (if any) holds
if self.victim:
if isinstance(self.victim.objectInterruptions, list):
self.victim.objectInterruptions.append(self)
def initialize(self):
from Globals import G
......
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