Commit 175a5a93 authored by Jérome Perrin's avatar Jérome Perrin

interarrivalTime and processingTime are required

parent f9dcb1c7
...@@ -171,7 +171,7 @@ def createObjects(): ...@@ -171,7 +171,7 @@ def createObjects():
if objClass=='Dream.Source': if objClass=='Dream.Source':
id=element.get('id', 'not found') id=element.get('id', 'not found')
name=element.get('name', 'not found') name=element.get('name', 'not found')
interarrivalTime=element.get('interarrivalTime', 'not found') interarrivalTime=element['interarrivalTime']
distributionType=interarrivalTime.get('distributionType', 'not found') distributionType=interarrivalTime.get('distributionType', 'not found')
mean=float(interarrivalTime.get('mean', '0')) mean=float(interarrivalTime.get('mean', '0'))
entity=str_to_class(element.get('entity', 'not found')) # initialize entity entity=str_to_class(element.get('entity', 'not found')) # initialize entity
...@@ -183,7 +183,7 @@ def createObjects(): ...@@ -183,7 +183,7 @@ def createObjects():
if objClass=='Dream.BatchSource': if objClass=='Dream.BatchSource':
id=element.get('id', 'not found') id=element.get('id', 'not found')
name=element.get('name', 'not found') name=element.get('name', 'not found')
interarrivalTime=element.get('interarrivalTime', 'not found') interarrivalTime=element['interarrivalTime']
distributionType=interarrivalTime.get('distributionType', 'not found') distributionType=interarrivalTime.get('distributionType', 'not found')
mean=float(interarrivalTime.get('mean', '0')) mean=float(interarrivalTime.get('mean', '0'))
entity=str_to_class(element.get('entity', 'not found')) entity=str_to_class(element.get('entity', 'not found'))
...@@ -197,7 +197,7 @@ def createObjects(): ...@@ -197,7 +197,7 @@ def createObjects():
elif objClass=='Dream.Machine': elif objClass=='Dream.Machine':
id=element.get('id', 'not found') id=element.get('id', 'not found')
name=element.get('name', 'not found') name=element.get('name', 'not found')
processingTime=element.get('processingTime', 'not found') processingTime=element['processingTime']
distributionType=processingTime.get('distributionType', 'not found') distributionType=processingTime.get('distributionType', 'not found')
mean=float(processingTime.get('mean', '0')) mean=float(processingTime.get('mean', '0'))
stdev=float(processingTime.get('stdev', '0')) stdev=float(processingTime.get('stdev', '0'))
...@@ -223,7 +223,7 @@ def createObjects(): ...@@ -223,7 +223,7 @@ def createObjects():
elif objClass=='Dream.BatchScrapMachine': elif objClass=='Dream.BatchScrapMachine':
id=element.get('id', 'not found') id=element.get('id', 'not found')
name=element.get('name', 'not found') name=element.get('name', 'not found')
processingTime=element.get('processingTime', 'not found') processingTime=element['processingTime']
distributionType=processingTime.get('distributionType', 'not found') distributionType=processingTime.get('distributionType', 'not found')
mean=float(processingTime.get('mean', '0')) mean=float(processingTime.get('mean', '0'))
stdev=float(processingTime.get('stdev', '0')) stdev=float(processingTime.get('stdev', '0'))
...@@ -258,7 +258,7 @@ def createObjects(): ...@@ -258,7 +258,7 @@ def createObjects():
elif objClass=='Dream.MachineJobShop': elif objClass=='Dream.MachineJobShop':
id=element.get('id', 'not found') id=element.get('id', 'not found')
name=element.get('name', 'not found') name=element.get('name', 'not found')
processingTime=element.get('processingTime', 'not found') processingTime=element['processingTime']
distributionType=processingTime.get('distributionType', 'not found') distributionType=processingTime.get('distributionType', 'not found')
mean=float(processingTime.get('mean', '0')) mean=float(processingTime.get('mean', '0'))
stdev=float(processingTime.get('stdev', '0')) stdev=float(processingTime.get('stdev', '0'))
...@@ -334,7 +334,7 @@ def createObjects(): ...@@ -334,7 +334,7 @@ def createObjects():
elif objClass=='Dream.Assembly': elif objClass=='Dream.Assembly':
id=element.get('id', 'not found') id=element.get('id', 'not found')
name=element.get('name', 'not found') name=element.get('name', 'not found')
processingTime=element.get('processingTime', 'not found') processingTime=element['processingTime']
distributionType=processingTime.get('distributionType', 'not found') distributionType=processingTime.get('distributionType', 'not found')
mean=float(processingTime.get('mean', '0')) mean=float(processingTime.get('mean', '0'))
stdev=float(processingTime.get('stdev', '0')) stdev=float(processingTime.get('stdev', '0'))
...@@ -348,7 +348,7 @@ def createObjects(): ...@@ -348,7 +348,7 @@ def createObjects():
elif objClass=='Dream.Dismantle': elif objClass=='Dream.Dismantle':
id=element.get('id', 'not found') id=element.get('id', 'not found')
name=element.get('name', 'not found') name=element.get('name', 'not found')
processingTime=element.get('processingTime', 'not found') processingTime=element['processingTime']
distributionType=processingTime.get('distributionType', 'not found') distributionType=processingTime.get('distributionType', 'not found')
mean=float(processingTime.get('mean', '0')) mean=float(processingTime.get('mean', '0'))
stdev=float(processingTime.get('stdev', '0')) stdev=float(processingTime.get('stdev', '0'))
...@@ -376,7 +376,7 @@ def createObjects(): ...@@ -376,7 +376,7 @@ def createObjects():
elif objClass=='Dream.BatchDecomposition': elif objClass=='Dream.BatchDecomposition':
id=element.get('id', 'not found') id=element.get('id', 'not found')
name=element.get('name', 'not found') name=element.get('name', 'not found')
processingTime=element.get('processingTime', 'not found') processingTime=element['processingTime']
distributionType=processingTime.get('distributionType', 'not found') distributionType=processingTime.get('distributionType', 'not found')
mean=float(processingTime.get('mean', '0')) mean=float(processingTime.get('mean', '0'))
stdev=float(processingTime.get('stdev', '0')) stdev=float(processingTime.get('stdev', '0'))
...@@ -392,7 +392,7 @@ def createObjects(): ...@@ -392,7 +392,7 @@ def createObjects():
elif objClass=='Dream.BatchReassembly': elif objClass=='Dream.BatchReassembly':
id=element.get('id', 'not found') id=element.get('id', 'not found')
name=element.get('name', 'not found') name=element.get('name', 'not found')
processingTime=element.get('processingTime', 'not found') processingTime=element['processingTime']
distributionType=processingTime.get('distributionType', 'not found') distributionType=processingTime.get('distributionType', 'not found')
mean=float(processingTime.get('mean', '0')) mean=float(processingTime.get('mean', '0'))
stdev=float(processingTime.get('stdev', '0')) stdev=float(processingTime.get('stdev', '0'))
...@@ -532,7 +532,7 @@ def createWIP(): ...@@ -532,7 +532,7 @@ def createWIP():
for routeentity in JSONRoute: # for each 'step' dictionary in the JSONRoute for routeentity in JSONRoute: # for each 'step' dictionary in the JSONRoute
stepNumber=int(routeentity.get('stepNumber', '0')) # get the stepNumber stepNumber=int(routeentity.get('stepNumber', '0')) # get the stepNumber
nextId=routeentity.get('stationId', 'not found') # the stationId nextId=routeentity.get('stationId', 'not found') # the stationId
processingTime=routeentity.get('processingTime', 'not found') # and the 'processingTime' dictionary processingTime=routeentity['processingTime'] # and the 'processingTime' dictionary
distributionType=processingTime.get('distributionType', 'not found')# and from that dictionary distributionType=processingTime.get('distributionType', 'not found')# and from that dictionary
# get the 'mean' # get the 'mean'
mean=float(processingTime.get('mean', 'not found')) mean=float(processingTime.get('mean', 'not found'))
......
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