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

better definition of objectInterruptions

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