Commit 4749c80e authored by Georgios Dagkakis's avatar Georgios Dagkakis

object to hold a list with interruptions for which they are victims

parent 8686c3ed
......@@ -49,6 +49,9 @@ class CoreObject(object):
self.Waiting=[]
self.OffShift=[]
# list that holds the objectInterruptions that have this element as victim
self.objectInterruptions=[]
#default attributes set so that the CoreObject has them
self.isPreemptive=False
self.resetOnPreemption=False
......
......@@ -1318,6 +1318,7 @@ 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)
......@@ -1331,6 +1332,7 @@ 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
......@@ -1350,6 +1352,7 @@ def createObjectInterruptions():
shiftPattern.remove(next)
endUnfinished=bool(int(shift.get('endUnfinished', 0)))
SS=ShiftScheduler(victim, shiftPattern, endUnfinished)
victim.objectInterruptions.append(SS)
G.ObjectInterruptionList.append(SS)
G.ShiftSchedulerList.append(SS)
......
......@@ -34,6 +34,8 @@ class ObjectResource(object):
def __init__(self):
self.initialized = False
# list that holds the objectInterruptions that have this element as victim
self.objectInterruptions=[]
# alias used for printing the trace
self.alias=None
......
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