Commit a461b4fe authored by Georgios Dagkakis's avatar Georgios Dagkakis

further cleanup

parent 12005824
No related merge requests found
...@@ -184,6 +184,7 @@ def createObjects(): ...@@ -184,6 +184,7 @@ def createObjects():
G.CapacityStationList=[] G.CapacityStationList=[]
G.CapacityStationExitList=[] G.CapacityStationExitList=[]
G.CapacityStationControllerList=[] G.CapacityStationControllerList=[]
G.ObjectInterruptionList=[]
''' '''
loop through all the model resources loop through all the model resources
...@@ -330,8 +331,9 @@ def createObjects(): ...@@ -330,8 +331,9 @@ def createObjects():
EV = EventGenerator(id, name, start=start, stop=stop, interval=interval, EV = EventGenerator(id, name, start=start, stop=stop, interval=interval,
duration=duration, method=method, argumentDict=argumentDict) # create the EventGenerator object duration=duration, method=method, argumentDict=argumentDict) # create the EventGenerator object
# calling the getSuccessorList() method on the repairman
G.EventGeneratorList.append(EV) # add the Event Generator to the RepairmanList G.EventGeneratorList.append(EV)
G.ObjectInterruptionList.append(EV)
elif elementClass=='Dream.CapacityStationController': # check the object type elif elementClass=='Dream.CapacityStationController': # check the object type
id = element.get('id', 'not found') # get the id of the element / default 'not_found' id = element.get('id', 'not found') # get the id of the element / default 'not_found'
...@@ -350,10 +352,10 @@ def createObjects(): ...@@ -350,10 +352,10 @@ def createObjects():
# create the CapacityStationController object # create the CapacityStationController object
CSC = CapacityStationController(id, name, start=start, stop=stop, interval=interval, CSC = CapacityStationController(id, name, start=start, stop=stop, interval=interval,
duration=duration, argumentDict=argumentDict, dueDateThreshold=dueDateThreshold, duration=duration, argumentDict=argumentDict, dueDateThreshold=dueDateThreshold,
prioritizeIfCanFinish=prioritizeIfCanFinish) prioritizeIfCanFinish=prioritizeIfCanFinish)
# calling the getSuccessorList() method on the repairman G.EventGeneratorList.append(CSC)
G.EventGeneratorList.append(CSC) # add the Event Generator to the RepairmanList
G.CapacityStationControllerList.append(CSC) G.CapacityStationControllerList.append(CSC)
G.ObjectInterruptionList.append(CSC)
# ----------------------------------------------------------------------- # -----------------------------------------------------------------------
# loop through all the core objects # loop through all the core objects
...@@ -411,30 +413,15 @@ def setTopology(): ...@@ -411,30 +413,15 @@ def setTopology():
# initializes all the objects that are in the topology # initializes all the objects that are in the topology
# =========================================================================== # ===========================================================================
def initializeObjects(): def initializeObjects():
for element in G.ObjList: for element in G.ObjList + G.ModelResourceList + G.EntityList + G.ObjectInterruptionList:
element.initialize() element.initialize()
for modelResource in G.ModelResourceList:
modelResource.initialize()
for entity in G.EntityList:
entity.initialize()
for ev in G.EventGeneratorList:
ev.initialize()
for oi in G.ObjectInterruptionList:
oi.initialize()
# =========================================================================== # ===========================================================================
# activates all the objects # activates all the objects
# =========================================================================== # ===========================================================================
def activateObjects(): def activateObjects():
for element in G.ObjList: for element in G.ObjList + G.ObjectInterruptionList:
# activate(element, element.run())
G.env.process(element.run()) G.env.process(element.run())
for ev in G.EventGeneratorList:
# activate(ev, ev.run())
G.env.process(ev.run())
for oi in G.ObjectInterruptionList:
# activate(oi, oi.run())
G.env.process(oi.run())
# =========================================================================== # ===========================================================================
# reads the WIP of the stations # reads the WIP of the stations
...@@ -770,7 +757,6 @@ def createWIP(): ...@@ -770,7 +757,6 @@ def createWIP():
# reads the interruptions of the stations # reads the interruptions of the stations
# =========================================================================== # ===========================================================================
def createObjectInterruptions(): def createObjectInterruptions():
G.ObjectInterruptionList=[]
G.ScheduledMaintenanceList=[] G.ScheduledMaintenanceList=[]
G.FailureList=[] G.FailureList=[]
G.ShiftSchedulerList=[] G.ShiftSchedulerList=[]
......
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