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 @@ ...@@ -71,11 +71,6 @@
}, },
"M1": { "M1": {
"_class": "Dream.Machine", "_class": "Dream.Machine",
"failures": {
"MTTF": "60",
"MTTR": "5",
"failureDistribution": "No"
},
"left": 0.6335403726708074, "left": 0.6335403726708074,
"name": "Machine1", "name": "Machine1",
"processingTime": { "processingTime": {
...@@ -87,9 +82,6 @@ ...@@ -87,9 +82,6 @@
"M2": { "M2": {
"_class": "Dream.Machine", "_class": "Dream.Machine",
"failures": { "failures": {
"MTTF": "40",
"MTTR": "10",
"failureDistribution": "No"
}, },
"left": 0.1863354037267081, "left": 0.1863354037267081,
"name": "Machine2", "name": "Machine2",
......
...@@ -92,8 +92,6 @@ ...@@ -92,8 +92,6 @@
"_class": "Dream.Machine", "_class": "Dream.Machine",
"left": 0.4414893617021277, "left": 0.4414893617021277,
"name": "Station2", "name": "Station2",
"failures": {
},
"processingTime": { "processingTime": {
"distributionType": "Fixed", "distributionType": "Fixed",
"mean": "1" "mean": "1"
...@@ -104,8 +102,6 @@ ...@@ -104,8 +102,6 @@
"_class": "Dream.Machine", "_class": "Dream.Machine",
"left": 0.4414893617021277, "left": 0.4414893617021277,
"name": "Station3", "name": "Station3",
"failures": {
},
"processingTime": { "processingTime": {
"distributionType": "Fixed", "distributionType": "Fixed",
"mean": "1" "mean": "1"
......
...@@ -52,8 +52,6 @@ ...@@ -52,8 +52,6 @@
"distributionType": "Fixed", "distributionType": "Fixed",
"mean": "0.25" "mean": "0.25"
}, },
"failures":{
},
"scrapQuantity":{ "scrapQuantity":{
"distributionType": "Fixed", "distributionType": "Fixed",
"mean": "2" "mean": "2"
...@@ -66,8 +64,6 @@ ...@@ -66,8 +64,6 @@
"distributionType": "Fixed", "distributionType": "Fixed",
"mean": "1" "mean": "1"
}, },
"failures":{
},
"scrapQuantity":{ "scrapQuantity":{
"distributionType": "Fixed", "distributionType": "Fixed",
"mean": "2" "mean": "2"
......
...@@ -54,12 +54,6 @@ ...@@ -54,12 +54,6 @@
"M1": { "M1": {
"_class": "Dream.OperatedMachine", "_class": "Dream.OperatedMachine",
"name": "Machine1", "name": "Machine1",
"failures": {
},
"setupTime": {
},
"loadTime": {
},
"processingTime": { "processingTime": {
"distributionType": "Fixed", "distributionType": "Fixed",
"mean": "17" "mean": "17"
......
...@@ -215,7 +215,7 @@ def createObjects(): ...@@ -215,7 +215,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['interarrivalTime'] interarrivalTime=element.get('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
...@@ -227,7 +227,7 @@ def createObjects(): ...@@ -227,7 +227,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['interarrivalTime'] interarrivalTime=element.get('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'))
...@@ -241,13 +241,13 @@ def createObjects(): ...@@ -241,13 +241,13 @@ 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['processingTime'] processingTime=element.get('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'))
min=float(processingTime.get('min', '0')) min=float(processingTime.get('min', '0'))
max=float(processingTime.get('max', '0')) max=float(processingTime.get('max', '0'))
failures=element.get('failures', 'not found') failures=element.get('failures', {})
failureDistribution=failures.get('failureDistribution', 'not found') failureDistribution=failures.get('failureDistribution', 'not found')
MTTF=float(failures.get('MTTF', '0')) MTTF=float(failures.get('MTTF', '0'))
MTTR=float(failures.get('MTTR', '0')) MTTR=float(failures.get('MTTR', '0'))
...@@ -267,19 +267,19 @@ def createObjects(): ...@@ -267,19 +267,19 @@ 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['processingTime'] processingTime=element.get('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'))
min=float(processingTime.get('min', '0')) min=float(processingTime.get('min', '0'))
max=float(processingTime.get('max', '0')) max=float(processingTime.get('max', '0'))
scrapQuantity=element.get('scrapQuantity', 'not found') scrapQuantity=element.get('scrapQuantity', {})
scrapDistributionType=scrapQuantity.get('distributionType', 'not found') scrapDistributionType=scrapQuantity.get('distributionType', 'not found')
scrMean=int(scrapQuantity.get('mean', '0')) scrMean=int(scrapQuantity.get('mean', '0'))
scrStdev=float(scrapQuantity.get('stdev', '0')) scrStdev=float(scrapQuantity.get('stdev', '0'))
scrMin=int(scrapQuantity.get('min', '0')) scrMin=int(scrapQuantity.get('min', '0'))
scrMax=int(scrapQuantity.get('max', '0')) scrMax=int(scrapQuantity.get('max', '0'))
failures=element.get('failures', 'not found') failures=element.get('failures', {})
failureDistribution=failures.get('failureDistribution', 'not found') failureDistribution=failures.get('failureDistribution', 'not found')
MTTF=float(failures.get('MTTF', '0')) MTTF=float(failures.get('MTTF', '0'))
MTTR=float(failures.get('MTTR', '0')) MTTR=float(failures.get('MTTR', '0'))
...@@ -302,19 +302,19 @@ def createObjects(): ...@@ -302,19 +302,19 @@ def createObjects():
elif objClass=='Dream.M3': elif objClass=='Dream.M3':
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.get('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'))
min=float(processingTime.get('min', '0')) min=float(processingTime.get('min', '0'))
max=float(processingTime.get('max', '0')) max=float(processingTime.get('max', '0'))
scrapQuantity=element.get('scrapQuantity', 'not found') scrapQuantity=element.get('scrapQuantity', {})
scrapDistributionType=scrapQuantity.get('distributionType', 'not found') scrapDistributionType=scrapQuantity.get('distributionType', 'not found')
scrMean=int(scrapQuantity.get('mean', '0')) scrMean=int(scrapQuantity.get('mean', '0'))
scrStdev=float(scrapQuantity.get('stdev', '0')) scrStdev=float(scrapQuantity.get('stdev', '0'))
scrMin=int(scrapQuantity.get('min', '0')) scrMin=int(scrapQuantity.get('min', '0'))
scrMax=int(scrapQuantity.get('max', '0')) scrMax=int(scrapQuantity.get('max', '0'))
failures=element.get('failures', 'not found') failures=element.get('failures', {})
failureDistribution=failures.get('failureDistribution', 'not found') failureDistribution=failures.get('failureDistribution', 'not found')
MTTF=float(failures.get('MTTF', '0')) MTTF=float(failures.get('MTTF', '0'))
MTTR=float(failures.get('MTTR', '0')) MTTR=float(failures.get('MTTR', '0'))
...@@ -337,13 +337,13 @@ def createObjects(): ...@@ -337,13 +337,13 @@ 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['processingTime'] processingTime=element.get('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'))
min=float(processingTime.get('min', '0')) min=float(processingTime.get('min', '0'))
max=float(processingTime.get('max', '0')) max=float(processingTime.get('max', '0'))
failures=element.get('failures', 'not found') failures=element.get('failures', {})
failureDistribution=failures.get('failureDistribution', 'not found') failureDistribution=failures.get('failureDistribution', 'not found')
MTTF=float(failures.get('MTTF', '0')) MTTF=float(failures.get('MTTF', '0'))
MTTR=float(failures.get('MTTR', '0')) MTTR=float(failures.get('MTTR', '0'))
...@@ -413,7 +413,7 @@ def createObjects(): ...@@ -413,7 +413,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['processingTime'] processingTime=element.get('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'))
...@@ -427,7 +427,7 @@ def createObjects(): ...@@ -427,7 +427,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['processingTime'] processingTime=element.get('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'))
...@@ -455,7 +455,7 @@ def createObjects(): ...@@ -455,7 +455,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['processingTime'] processingTime=element.get('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'))
...@@ -471,7 +471,7 @@ def createObjects(): ...@@ -471,7 +471,7 @@ def createObjects():
elif objClass=='Dream.BatchDecompositionStartTime': elif objClass=='Dream.BatchDecompositionStartTime':
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.get('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'))
...@@ -488,7 +488,7 @@ def createObjects(): ...@@ -488,7 +488,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['processingTime'] processingTime=element.get('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'))
...@@ -515,28 +515,26 @@ def createObjects(): ...@@ -515,28 +515,26 @@ def createObjects():
elif objClass=='Dream.OperatedMachine': elif objClass=='Dream.OperatedMachine':
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', {})
processingTime=element.get('processingTime', 'not found')
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'))
min=float(processingTime.get('min', '0')) min=float(processingTime.get('min', '0'))
max=float(processingTime.get('max', '0')) max=float(processingTime.get('max', '0'))
failures=element.get('failures', {})
failures=element.get('failures', 'not found')
failureDistribution=failures.get('failureDistribution', 'not found') failureDistribution=failures.get('failureDistribution', 'not found')
MTTF=float(failures.get('MTTF', '0')) MTTF=float(failures.get('MTTF', '0'))
MTTR=float(failures.get('MTTR', '0')) MTTR=float(failures.get('MTTR', '0'))
availability=float(failures.get('availability', '0')) availability=float(failures.get('availability', '0'))
operationType=element.get('operationType','not found') operationType=element.get('operationType','not found')
setupTime = element.get('setupTime','not found') setupTime = element.get('setupTime',{})
setupDistribution = setupTime.get('setupDistribution','not found') setupDistribution = setupTime.get('setupDistribution','not found')
setupMean = float(setupTime.get('setupMean','0')) setupMean = float(setupTime.get('setupMean','0'))
setupStdev=float(setupTime.get('setupStdev', '0')) setupStdev=float(setupTime.get('setupStdev', '0'))
setupMin=float(setupTime.get('setupMin', '0')) setupMin=float(setupTime.get('setupMin', '0'))
setupMax=float(setupTime.get('setupMax', '0')) setupMax=float(setupTime.get('setupMax', '0'))
loadTime = element.get('loadTime','not found') loadTime = element.get('loadTime',{})
loadDistribution = loadTime.get('loadDistribution','not found') loadDistribution = loadTime.get('loadDistribution','not found')
loadMean = float(loadTime.get('loadMean','0')) loadMean = float(loadTime.get('loadMean','0'))
loadStdev = float(loadTime.get('loadStdev', '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