Commit d8abad93 authored by Georgios Dagkakis's avatar Georgios Dagkakis

Exit updated

parent 63d66d46
...@@ -77,6 +77,8 @@ class CoreObject(object): ...@@ -77,6 +77,8 @@ class CoreObject(object):
def parseInputs(self, inputsDict): def parseInputs(self, inputsDict):
self.id = inputsDict.get('id') self.id = inputsDict.get('id')
self.objName = inputsDict.get('name') self.objName = inputsDict.get('name')
from Globals import G
G.ObjList.append(self) # add object to ObjList
def initialize(self): def initialize(self):
from Globals import G from Globals import G
......
...@@ -36,20 +36,27 @@ from CoreObject import CoreObject ...@@ -36,20 +36,27 @@ from CoreObject import CoreObject
class Exit(CoreObject): class Exit(CoreObject):
family='Exit' family='Exit'
def __init__(self, id, name=None):
if not name: def __init__(self, id='', name='', inputsDict={}):
name = id
CoreObject.__init__(self, id, name)
self.predecessorIndex=0 # holds the index of the predecessor from which the Exit will take an entity next
# general properties of the Exit
self.type="Exit" # XXX needed ? self.type="Exit" # XXX needed ?
#lists to hold statistics of multiple runs #lists to hold statistics of multiple runs
self.Exits=[] self.Exits=[]
self.UnitExits=[] self.UnitExits=[]
self.Lifespan=[] self.Lifespan=[]
self.TaktTime=[] self.TaktTime=[]
# if input is given in a dictionary
if inputsDict:
CoreObject.__init__(self, inputsDict=inputsDict)
else:
CoreObject.__init__(self, id, name)
# =======================================================================
# parses inputs if they are given in a dictionary
# =======================================================================
def parseInputs(self, inputsDict):
CoreObject.parseInputs(self, inputsDict)
from Globals import G
G.ExitList.append(self)
def initialize(self): def initialize(self):
# using the Process __init__ and not the CoreObject __init__ # using the Process __init__ and not the CoreObject __init__
......
...@@ -227,8 +227,6 @@ class Machine(CoreObject): ...@@ -227,8 +227,6 @@ class Machine(CoreObject):
G.MachineList.append(self) # add machine to global MachineList G.MachineList.append(self) # add machine to global MachineList
if self.operatorPool!="None": if self.operatorPool!="None":
G.OperatedMachineList.append(self) # add the machine to the operatedMachines List G.OperatedMachineList.append(self) # add the machine to the operatedMachines List
G.ObjList.append(self) # add machine to ObjList
# ======================================================================= # =======================================================================
# initialize the machine # initialize the machine
......
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