Commit 70bfa1f3 authored by Georgios Dagkakis's avatar Georgios Dagkakis Committed by Jérome Perrin

initialize of CoreObject and ObjectInterruption to call init of the parent...

initialize of CoreObject and ObjectInterruption to call init of the parent process so that multiple runs work good
parent 7ca7e5ee
......@@ -37,10 +37,15 @@ class CoreObject(Process):
self.previous=[] #list with the previous objects in the flow
self.nextIds=[] #list with the ids of the next objects in the flow
self.previousIds=[] #list with the ids of the previous objects in the flow
self.Failure=[]
self.Working=[]
self.Blockage=[]
self.Waiting=[]
def initialize(self):
# Process.__init__(self)
Process.__init__(self)
self.Up=True #Boolean that shows if the machine is in failure ("Down") or not ("up")
self.currentEntity=None
# ============================== total times ===============================================
......@@ -91,11 +96,6 @@ class CoreObject(Process):
self.setupTimeCurrentEntity=0
self.shouldPreempt=False #flag that shows that the machine should preempt or not
self.Failure=[]
self.Working=[]
self.Blockage=[]
self.Waiting=[]
# ======================== the main process of the core object =================================
# ================ this is dummy, every object must have its own implementation ================
......
......@@ -33,10 +33,10 @@ from ObjectInterruption import ObjectInterruption
class Failure(ObjectInterruption):
def __init__(self, victim=None, dist='Fixed', MTTF=60, MTTR=5, availability=100, index=0, repairman=None):
def __init__(self, victim=None, distributionType='Fixed', MTTF=60, MTTR=5, availability=100, index=0, repairman=None):
#Process.__init__(self)
ObjectInterruption.__init__(self,victim)
self.distType=dist # the distribution that the failure duration follows
self.distType=distributionType # the distribution that the failure duration follows
self.MTTF=MTTF # the MTTF
self.MTTR=MTTR # the MTTR
self.availability=availability # the availability
......
......@@ -981,7 +981,7 @@ def main(argv=[], input_data=None):
activateObjects()
# if the simulation is ran until no more events are scheduled,
# then we have to find the end time as the time the last entity ended.
# then we have to find the end time as the time the last entity ended.
if G.maxSimTime==-1:
simulate(until=infinity) # simulate until there are no more events.
# If someone does it for a model that has always events, then it will run forever!
......
......@@ -35,7 +35,7 @@ class ObjectInterruption(Process):
self.victim=victim
def initialize(self):
pass
Process.__init__(self)
#the main process of the core object
#this is dummy, every object must have its own implementation
......
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