Commit acc2fa6f authored by Georgios Dagkakis's avatar Georgios Dagkakis

CapacityStationController to read in new way

parent 833e4c02
...@@ -32,8 +32,8 @@ from CapacityEntity import CapacityEntity ...@@ -32,8 +32,8 @@ from CapacityEntity import CapacityEntity
from Globals import G from Globals import G
class CapacityStationController(EventGenerator): class CapacityStationController(EventGenerator):
def __init__(self, id=id, name=None, start=None, stop=None, interval=None, def __init__(self, id=id, name=None, start=0, stop=float('inf'), interval=1,
duration=None, method=None, argumentDict=None, dueDateThreshold=float('inf'), prioritizeIfCanFinish=False): duration=0, method=None, argumentDict=None, dueDateThreshold=float('inf'), prioritizeIfCanFinish=False):
EventGenerator.__init__(self, id, name, start, stop, interval, EventGenerator.__init__(self, id, name, start, stop, interval,
duration, method, argumentDict) duration, method, argumentDict)
# attribute used by optimization in calculateWhatIsToBeProcessed # attribute used by optimization in calculateWhatIsToBeProcessed
......
...@@ -197,9 +197,6 @@ ...@@ -197,9 +197,6 @@
"CSC": { "CSC": {
"_class": "Dream.CapacityStationController", "_class": "Dream.CapacityStationController",
"name": "CSC", "name": "CSC",
"start": "0", "interval": "1" }
"interval": "1",
"method": "Dream.None"
}
} }
} }
\ No newline at end of file
...@@ -161,7 +161,6 @@ ...@@ -161,7 +161,6 @@
"name": "CSC", "name": "CSC",
"start": "0", "start": "0",
"interval": "1", "interval": "1",
"method": "Dream.None",
"prioritizeIfCanFinish": 1, "prioritizeIfCanFinish": 1,
"dueDateThreshold": 7 "dueDateThreshold": 7
} }
......
...@@ -200,7 +200,6 @@ ...@@ -200,7 +200,6 @@
"name": "CSC", "name": "CSC",
"start": "0", "start": "0",
"interval": "1", "interval": "1",
"method": "Dream.None",
"dueDateThreshold":7 "dueDateThreshold":7
} }
} }
......
...@@ -200,7 +200,6 @@ ...@@ -200,7 +200,6 @@
"name": "CSC", "name": "CSC",
"start": "0", "start": "0",
"interval": "1", "interval": "1",
"method": "Dream.None",
"dueDateThreshold":7 "dueDateThreshold":7
} }
} }
......
...@@ -200,7 +200,6 @@ ...@@ -200,7 +200,6 @@
"name": "CSC", "name": "CSC",
"start": "0", "start": "0",
"interval": "1", "interval": "1",
"method": "Dream.None",
"dueDateThreshold":14 "dueDateThreshold":14
} }
} }
......
...@@ -100,7 +100,6 @@ ...@@ -100,7 +100,6 @@
"name": "CSC", "name": "CSC",
"start": "0", "start": "0",
"interval": "1", "interval": "1",
"method": "Dream.None",
"dueDateThreshold": 7 "dueDateThreshold": 7
} }
} }
......
...@@ -100,7 +100,6 @@ ...@@ -100,7 +100,6 @@
"name": "CSC", "name": "CSC",
"start": "0", "start": "0",
"interval": "1", "interval": "1",
"method": "Dream.None",
"dueDateThreshold": 7 "dueDateThreshold": 7
} }
} }
......
...@@ -201,8 +201,7 @@ ...@@ -201,8 +201,7 @@
"_class": "Dream.CapacityStationController", "_class": "Dream.CapacityStationController",
"name": "CSC", "name": "CSC",
"start": "0", "start": "0",
"interval": "1", "interval": "1"
"method": "Dream.None"
} }
} }
} }
\ No newline at end of file
...@@ -204,8 +204,7 @@ ...@@ -204,8 +204,7 @@
"_class": "Dream.CapacityStationController", "_class": "Dream.CapacityStationController",
"name": "CSC", "name": "CSC",
"start": "0", "start": "0",
"interval": "1", "interval": "1"
"method": "Dream.None"
} }
} }
} }
\ No newline at end of file
...@@ -100,7 +100,6 @@ ...@@ -100,7 +100,6 @@
"name": "CSC", "name": "CSC",
"start": "0", "start": "0",
"interval": "1", "interval": "1",
"method": "Dream.None",
"prioritizeIfCanFinish": 1, "prioritizeIfCanFinish": 1,
"dueDateThreshold": 7 "dueDateThreshold": 7
} }
......
...@@ -100,7 +100,6 @@ ...@@ -100,7 +100,6 @@
"name": "CSC", "name": "CSC",
"start": "0", "start": "0",
"interval": "1", "interval": "1",
"method": "Dream.None",
"prioritizeIfCanFinish": 1, "prioritizeIfCanFinish": 1,
"dueDateThreshold": 7 "dueDateThreshold": 7
} }
......
...@@ -100,7 +100,6 @@ ...@@ -100,7 +100,6 @@
"name": "CSC", "name": "CSC",
"start": "0", "start": "0",
"interval": "1", "interval": "1",
"method": "Dream.None",
"prioritizeIfCanFinish": 1, "prioritizeIfCanFinish": 1,
"dueDateThreshold": 7 "dueDateThreshold": 7
} }
......
...@@ -123,7 +123,6 @@ ...@@ -123,7 +123,6 @@
"name": "CSC", "name": "CSC",
"start": "0", "start": "0",
"interval": "1", "interval": "1",
"method": "Dream.None",
"prioritizeIfCanFinish": 1, "prioritizeIfCanFinish": 1,
"dueDateThreshold": 7 "dueDateThreshold": 7
} }
......
...@@ -131,7 +131,6 @@ ...@@ -131,7 +131,6 @@
"name": "CSC", "name": "CSC",
"start": "0", "start": "0",
"interval": "1", "interval": "1",
"method": "Dream.None",
"prioritizeIfCanFinish": 1, "prioritizeIfCanFinish": 1,
"dueDateThreshold": 7 "dueDateThreshold": 7
} }
......
...@@ -124,7 +124,6 @@ ...@@ -124,7 +124,6 @@
"name": "CSC", "name": "CSC",
"start": "0", "start": "0",
"interval": "1", "interval": "1",
"method": "Dream.None",
"prioritizeIfCanFinish": 1, "prioritizeIfCanFinish": 1,
"dueDateThreshold": 7 "dueDateThreshold": 7
} }
......
...@@ -138,7 +138,6 @@ ...@@ -138,7 +138,6 @@
"name": "CSC", "name": "CSC",
"start": "0", "start": "0",
"interval": "1", "interval": "1",
"method": "Dream.None",
"prioritizeIfCanFinish": 1, "prioritizeIfCanFinish": 1,
"dueDateThreshold": 7 "dueDateThreshold": 7
} }
......
...@@ -137,7 +137,6 @@ ...@@ -137,7 +137,6 @@
"name": "CSC", "name": "CSC",
"start": "0", "start": "0",
"interval": "1", "interval": "1",
"method": "Dream.None",
"prioritizeIfCanFinish": 1, "prioritizeIfCanFinish": 1,
"dueDateThreshold": 7 "dueDateThreshold": 7
} }
......
...@@ -133,7 +133,6 @@ ...@@ -133,7 +133,6 @@
"name": "CSC", "name": "CSC",
"start": "0", "start": "0",
"interval": "1", "interval": "1",
"method": "Dream.None",
"prioritizeIfCanFinish": 1, "prioritizeIfCanFinish": 1,
"dueDateThreshold": 7 "dueDateThreshold": 7
} }
......
...@@ -198,8 +198,7 @@ ...@@ -198,8 +198,7 @@
"_class": "Dream.CapacityStationController", "_class": "Dream.CapacityStationController",
"name": "CSC", "name": "CSC",
"start": "0", "start": "0",
"interval": "1", "interval": "1"
"method": "Dream.None"
} }
} }
} }
\ No newline at end of file
...@@ -704,33 +704,33 @@ def createObjectInterruptions(): ...@@ -704,33 +704,33 @@ def createObjectInterruptions():
# from CoreObject import CoreObject # from CoreObject import CoreObject
# if issubclass(objectType, CoreObject): # if issubclass(objectType, CoreObject):
if objClass=='Dream.EventGenerator': # check the object type if objClass in ['Dream.EventGenerator', 'Dream.CapacityStationController']: # check the object type
inputDict=dict(element) inputDict=dict(element)
# create the CoreObject # create the ObjectInterruption
objectInterruption=objectType(**inputDict) objectInterruption=objectType(**inputDict)
G.ObjectInterruptionList.append(objectInterruption) G.ObjectInterruptionList.append(objectInterruption)
elif objClass=='Dream.CapacityStationController': # check the object type # elif objClass=='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'
name = element.get('name', 'not found') # get the name of the element / default 'not_found' # name = element.get('name', 'not found') # get the name of the element / default 'not_found'
start = float(element.get('start') or 0) # start = float(element.get('start') or 0)
stop = float(element.get('stop') or -1) # stop = float(element.get('stop') or -1)
# infinity (had to be done to make it as float) # # infinity (had to be done to make it as float)
if stop<0: # if stop<0:
stop=float('inf') # stop=float('inf')
interval = float(element.get('interval') or 1) # interval = float(element.get('interval') or 1)
duration = float(element.get('duration') or 0) # duration = float(element.get('duration') or 0)
dueDateThreshold = float(element.get('dueDateThreshold') or float('inf')) # dueDateThreshold = float(element.get('dueDateThreshold') or float('inf'))
prioritizeIfCanFinish = bool(element.get('prioritizeIfCanFinish', 0)) # prioritizeIfCanFinish = bool(element.get('prioritizeIfCanFinish', 0))
argumentDict=(element.get('argumentDict', {})) # get the arguments of the method as a dict / default {} # argumentDict=(element.get('argumentDict', {})) # get the arguments of the method as a dict / default {}
#
# 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)
G.EventGeneratorList.append(CSC) # G.EventGeneratorList.append(CSC)
G.CapacityStationControllerList.append(CSC) # G.CapacityStationControllerList.append(CSC)
G.ObjectInterruptionList.append(CSC) # G.ObjectInterruptionList.append(CSC)
# for the elements in the nodes dict # for the elements in the nodes dict
for (element_id, element) in nodes.iteritems(): for (element_id, element) in nodes.iteritems():
......
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