Commit 3683fd0d authored by Georgios Dagkakis's avatar Georgios Dagkakis Committed by Jérome Perrin

main script updated so that whenever a json object is expected and not found...

main script updated so that whenever a json object is expected and not found the default would be {}. So we do not need to have e.g. empty failures. Changes reflected also in several ropologies
parent 4e6513f6
......@@ -71,11 +71,6 @@
},
"M1": {
"_class": "Dream.Machine",
"failures": {
"MTTF": "60",
"MTTR": "5",
"failureDistribution": "No"
},
"left": 0.6335403726708074,
"name": "Machine1",
"processingTime": {
......@@ -87,9 +82,6 @@
"M2": {
"_class": "Dream.Machine",
"failures": {
"MTTF": "40",
"MTTR": "10",
"failureDistribution": "No"
},
"left": 0.1863354037267081,
"name": "Machine2",
......
......@@ -92,8 +92,6 @@
"_class": "Dream.Machine",
"left": 0.4414893617021277,
"name": "Station2",
"failures": {
},
"processingTime": {
"distributionType": "Fixed",
"mean": "1"
......@@ -104,8 +102,6 @@
"_class": "Dream.Machine",
"left": 0.4414893617021277,
"name": "Station3",
"failures": {
},
"processingTime": {
"distributionType": "Fixed",
"mean": "1"
......
......@@ -52,8 +52,6 @@
"distributionType": "Fixed",
"mean": "0.25"
},
"failures":{
},
"scrapQuantity":{
"distributionType": "Fixed",
"mean": "2"
......@@ -66,8 +64,6 @@
"distributionType": "Fixed",
"mean": "1"
},
"failures":{
},
"scrapQuantity":{
"distributionType": "Fixed",
"mean": "2"
......
......@@ -54,12 +54,6 @@
"M1": {
"_class": "Dream.OperatedMachine",
"name": "Machine1",
"failures": {
},
"setupTime": {
},
"loadTime": {
},
"processingTime": {
"distributionType": "Fixed",
"mean": "17"
......
......@@ -215,7 +215,7 @@ def createObjects():
if objClass=='Dream.Source':
id=element.get('id', 'not found')
name=element.get('name', 'not found')
interarrivalTime=element['interarrivalTime']
interarrivalTime=element.get('interarrivalTime',{})
distributionType=interarrivalTime.get('distributionType', 'not found')
mean=float(interarrivalTime.get('mean', '0'))
entity=str_to_class(element.get('entity', 'not found')) # initialize entity
......@@ -227,7 +227,7 @@ def createObjects():
if objClass=='Dream.BatchSource':
id=element.get('id', 'not found')
name=element.get('name', 'not found')
interarrivalTime=element['interarrivalTime']
interarrivalTime=element.get('interarrivalTime',{})
distributionType=interarrivalTime.get('distributionType', 'not found')
mean=float(interarrivalTime.get('mean', '0'))
entity=str_to_class(element.get('entity', 'not found'))
......@@ -241,13 +241,13 @@ def createObjects():
elif objClass=='Dream.Machine':
id=element.get('id', 'not found')
name=element.get('name', 'not found')
processingTime=element['processingTime']
processingTime=element.get('processingTime',{})
distributionType=processingTime.get('distributionType', 'not found')
mean=float(processingTime.get('mean', '0'))
stdev=float(processingTime.get('stdev', '0'))
min=float(processingTime.get('min', '0'))
max=float(processingTime.get('max', '0'))
failures=element.get('failures', 'not found')
failures=element.get('failures', {})
failureDistribution=failures.get('failureDistribution', 'not found')
MTTF=float(failures.get('MTTF', '0'))
MTTR=float(failures.get('MTTR', '0'))
......@@ -267,19 +267,19 @@ def createObjects():
elif objClass=='Dream.BatchScrapMachine':
id=element.get('id', 'not found')
name=element.get('name', 'not found')
processingTime=element['processingTime']
processingTime=element.get('processingTime',{})
distributionType=processingTime.get('distributionType', 'not found')
mean=float(processingTime.get('mean', '0'))
stdev=float(processingTime.get('stdev', '0'))
min=float(processingTime.get('min', '0'))
max=float(processingTime.get('max', '0'))
scrapQuantity=element.get('scrapQuantity', 'not found')
scrapQuantity=element.get('scrapQuantity', {})
scrapDistributionType=scrapQuantity.get('distributionType', 'not found')
scrMean=int(scrapQuantity.get('mean', '0'))
scrStdev=float(scrapQuantity.get('stdev', '0'))
scrMin=int(scrapQuantity.get('min', '0'))
scrMax=int(scrapQuantity.get('max', '0'))
failures=element.get('failures', 'not found')
failures=element.get('failures', {})
failureDistribution=failures.get('failureDistribution', 'not found')
MTTF=float(failures.get('MTTF', '0'))
MTTR=float(failures.get('MTTR', '0'))
......@@ -302,19 +302,19 @@ def createObjects():
elif objClass=='Dream.M3':
id=element.get('id', 'not found')
name=element.get('name', 'not found')
processingTime=element.get('processingTime', 'not found')
processingTime=element.get('processingTime', {})
distributionType=processingTime.get('distributionType', 'not found')
mean=float(processingTime.get('mean', '0'))
stdev=float(processingTime.get('stdev', '0'))
min=float(processingTime.get('min', '0'))
max=float(processingTime.get('max', '0'))
scrapQuantity=element.get('scrapQuantity', 'not found')
scrapQuantity=element.get('scrapQuantity', {})
scrapDistributionType=scrapQuantity.get('distributionType', 'not found')
scrMean=int(scrapQuantity.get('mean', '0'))
scrStdev=float(scrapQuantity.get('stdev', '0'))
scrMin=int(scrapQuantity.get('min', '0'))
scrMax=int(scrapQuantity.get('max', '0'))
failures=element.get('failures', 'not found')
failures=element.get('failures', {})
failureDistribution=failures.get('failureDistribution', 'not found')
MTTF=float(failures.get('MTTF', '0'))
MTTR=float(failures.get('MTTR', '0'))
......@@ -337,13 +337,13 @@ def createObjects():
elif objClass=='Dream.MachineJobShop':
id=element.get('id', 'not found')
name=element.get('name', 'not found')
processingTime=element['processingTime']
processingTime=element.get('processingTime', {})
distributionType=processingTime.get('distributionType', 'not found')
mean=float(processingTime.get('mean', '0'))
stdev=float(processingTime.get('stdev', '0'))
min=float(processingTime.get('min', '0'))
max=float(processingTime.get('max', '0'))
failures=element.get('failures', 'not found')
failures=element.get('failures', {})
failureDistribution=failures.get('failureDistribution', 'not found')
MTTF=float(failures.get('MTTF', '0'))
MTTR=float(failures.get('MTTR', '0'))
......@@ -413,7 +413,7 @@ def createObjects():
elif objClass=='Dream.Assembly':
id=element.get('id', 'not found')
name=element.get('name', 'not found')
processingTime=element['processingTime']
processingTime=element.get('processingTime', {})
distributionType=processingTime.get('distributionType', 'not found')
mean=float(processingTime.get('mean', '0'))
stdev=float(processingTime.get('stdev', '0'))
......@@ -427,7 +427,7 @@ def createObjects():
elif objClass=='Dream.Dismantle':
id=element.get('id', 'not found')
name=element.get('name', 'not found')
processingTime=element['processingTime']
processingTime=element.get('processingTime', {})
distributionType=processingTime.get('distributionType', 'not found')
mean=float(processingTime.get('mean', '0'))
stdev=float(processingTime.get('stdev', '0'))
......@@ -455,7 +455,7 @@ def createObjects():
elif objClass=='Dream.BatchDecomposition':
id=element.get('id', 'not found')
name=element.get('name', 'not found')
processingTime=element['processingTime']
processingTime=element.get('processingTime', {})
distributionType=processingTime.get('distributionType', 'not found')
mean=float(processingTime.get('mean', '0'))
stdev=float(processingTime.get('stdev', '0'))
......@@ -471,7 +471,7 @@ def createObjects():
elif objClass=='Dream.BatchDecompositionStartTime':
id=element.get('id', 'not found')
name=element.get('name', 'not found')
processingTime=element.get('processingTime', 'not found')
processingTime=element.get('processingTime', {})
distributionType=processingTime.get('distributionType', 'not found')
mean=float(processingTime.get('mean', '0'))
stdev=float(processingTime.get('stdev', '0'))
......@@ -488,7 +488,7 @@ def createObjects():
elif objClass=='Dream.BatchReassembly':
id=element.get('id', 'not found')
name=element.get('name', 'not found')
processingTime=element['processingTime']
processingTime=element.get('processingTime', {})
distributionType=processingTime.get('distributionType', 'not found')
mean=float(processingTime.get('mean', '0'))
stdev=float(processingTime.get('stdev', '0'))
......@@ -515,28 +515,26 @@ def createObjects():
elif objClass=='Dream.OperatedMachine':
id=element.get('id', 'not found')
name=element.get('name', 'not found')
processingTime=element.get('processingTime', 'not found')
processingTime=element.get('processingTime', {})
distributionType=processingTime.get('distributionType', 'not found')
mean=float(processingTime.get('mean', '0'))
stdev=float(processingTime.get('stdev', '0'))
min=float(processingTime.get('min', '0'))
max=float(processingTime.get('max', '0'))
failures=element.get('failures', 'not found')
max=float(processingTime.get('max', '0'))
failures=element.get('failures', {})
failureDistribution=failures.get('failureDistribution', 'not found')
MTTF=float(failures.get('MTTF', '0'))
MTTR=float(failures.get('MTTR', '0'))
availability=float(failures.get('availability', '0'))
operationType=element.get('operationType','not found')
setupTime = element.get('setupTime','not found')
setupTime = element.get('setupTime',{})
setupDistribution = setupTime.get('setupDistribution','not found')
setupMean = float(setupTime.get('setupMean','0'))
setupStdev=float(setupTime.get('setupStdev', '0'))
setupMin=float(setupTime.get('setupMin', '0'))
setupMax=float(setupTime.get('setupMax', '0'))
loadTime = element.get('loadTime','not found')
loadTime = element.get('loadTime',{})
loadDistribution = loadTime.get('loadDistribution','not found')
loadMean = float(loadTime.get('loadMean','0'))
loadStdev = float(loadTime.get('loadStdev', '0'))
......
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