Commit 5c41eee8 authored by Georgios Dagkakis's avatar Georgios Dagkakis

main script updated to read new JSON notation (elementList and definition of...

main script updated to read new JSON notation (elementList and definition of successorList in Repairman). Only tested in Topology01 for now
parent c2b64c63
...@@ -341,7 +341,7 @@ class Assembly(Process): ...@@ -341,7 +341,7 @@ class Assembly(Process):
json['results']['waiting_ratio']['avg']=self.Waiting[0] json['results']['waiting_ratio']['avg']=self.Waiting[0]
json['results']['waiting_ratio']['max']=self.Waiting[0] json['results']['waiting_ratio']['max']=self.Waiting[0]
G.outputJSON['coreObject'].append(json) G.outputJSON['elementList'].append(json)
......
...@@ -382,7 +382,7 @@ class Conveyer(Process): ...@@ -382,7 +382,7 @@ class Conveyer(Process):
json['results']['waiting_ratio']['min']=self.Waiting[0] json['results']['waiting_ratio']['min']=self.Waiting[0]
json['results']['waiting_ratio']['avg']=self.Waiting[0] json['results']['waiting_ratio']['avg']=self.Waiting[0]
json['results']['waiting_ratio']['max']=self.Waiting[0] json['results']['waiting_ratio']['max']=self.Waiting[0]
G.outputJSON['coreObject'].append(json) G.outputJSON['elementList'].append(json)
#takes the array and checks if all its values are identical (returns false) or not (returns true) #takes the array and checks if all its values are identical (returns false) or not (returns true)
#needed because if somebody runs multiple runs in deterministic case it would crash! #needed because if somebody runs multiple runs in deterministic case it would crash!
......
...@@ -339,7 +339,7 @@ class Dismantle(Process): ...@@ -339,7 +339,7 @@ class Dismantle(Process):
json['results']['waiting_ratio']['avg']=self.Waiting[0] json['results']['waiting_ratio']['avg']=self.Waiting[0]
json['results']['waiting_ratio']['max']=self.Waiting[0] json['results']['waiting_ratio']['max']=self.Waiting[0]
G.outputJSON['coreObject'].append(json) G.outputJSON['elementList'].append(json)
#takes the array and checks if all its values are identical (returns false) or not (returns true) #takes the array and checks if all its values are identical (returns false) or not (returns true)
#needed because if somebody runs multiple runs in deterministic case it would crash! #needed because if somebody runs multiple runs in deterministic case it would crash!
......
...@@ -249,7 +249,7 @@ class Exit(Process): ...@@ -249,7 +249,7 @@ class Exit(Process):
json['results']['taktTime']['min']=self.TaktTime[0] json['results']['taktTime']['min']=self.TaktTime[0]
json['results']['taktTime']['avg']=self.TaktTime[0] json['results']['taktTime']['avg']=self.TaktTime[0]
json['results']['taktTime']['max']=self.TaktTime[0] json['results']['taktTime']['max']=self.TaktTime[0]
G.outputJSON['coreObject'].append(json) G.outputJSON['elementList'].append(json)
#takes the array and checks if all its values are identical (returns false) or not (returns true) #takes the array and checks if all its values are identical (returns false) or not (returns true)
#needed because if somebody runs multiple runs in deterministic case it would crash! #needed because if somebody runs multiple runs in deterministic case it would crash!
......
...@@ -6,14 +6,13 @@ ...@@ -6,14 +6,13 @@
"trace": "No", "trace": "No",
"confidenceLevel": "0.95" "confidenceLevel": "0.95"
}, },
"modelResource": [ "elementList": [
{"_class": "Dream.Repairman", {"_class": "Dream.Repairman",
"id": "W1", "id": "W1",
"name": "W1", "name": "W1",
"capacity": "1" "capacity": "1",
} "successorList": ["M1", "M2"]
], },
"coreObject": [
{"_class": "Dream.Source", {"_class": "Dream.Source",
"id": "S1", "id": "S1",
"name": "Raw Material", "name": "Raw Material",
...@@ -35,8 +34,7 @@ ...@@ -35,8 +34,7 @@
"failures":{ "failures":{
"failureDistribution": "Fixed", "failureDistribution": "Fixed",
"MTTF": "60", "MTTF": "60",
"MTTR": "5", "MTTR": "5"
"repairman": "W1"
}, },
"successorList": ["Q1"] "successorList": ["Q1"]
}, },
...@@ -50,8 +48,7 @@ ...@@ -50,8 +48,7 @@
"failures":{ "failures":{
"failureDistribution": "Fixed", "failureDistribution": "Fixed",
"MTTF": "40", "MTTF": "40",
"MTTR": "10", "MTTR": "10"
"repairman": "W1"
}, },
"successorList": ["E1"] "successorList": ["E1"]
}, },
......
This diff is collapsed.
...@@ -496,7 +496,7 @@ class Machine(Process): ...@@ -496,7 +496,7 @@ class Machine(Process):
json['results']['waiting_ratio']['avg']=self.Waiting[0] json['results']['waiting_ratio']['avg']=self.Waiting[0]
json['results']['waiting_ratio']['max']=self.Waiting[0] json['results']['waiting_ratio']['max']=self.Waiting[0]
G.outputJSON['coreObject'].append(json) G.outputJSON['elementList'].append(json)
#takes the array and checks if all its values are identical (returns false) or not (returns true) #takes the array and checks if all its values are identical (returns false) or not (returns true)
......
...@@ -43,6 +43,8 @@ class Repairman(object): ...@@ -43,6 +43,8 @@ class Repairman(object):
self.Waiting=[] self.Waiting=[]
self.Working=[] self.Working=[]
self.coreObjectIds=[] #list with the coreObjects that the repairman repairs
def initialize(self): def initialize(self):
self.totalWorkingTime=0 #holds the total working time self.totalWorkingTime=0 #holds the total working time
self.totalWaitingTime=0 #holds the total waiting time self.totalWaitingTime=0 #holds the total waiting time
...@@ -140,7 +142,7 @@ class Repairman(object): ...@@ -140,7 +142,7 @@ class Repairman(object):
json['results']['waiting_ratio']['avg']=self.Waiting[0] json['results']['waiting_ratio']['avg']=self.Waiting[0]
json['results']['waiting_ratio']['max']=self.Waiting[0] json['results']['waiting_ratio']['max']=self.Waiting[0]
G.outputJSON['coreObject'].append(json) G.outputJSON['elementList'].append(json)
#takes the array and checks if all its values are identical (returns false) or not (returns true) #takes the array and checks if all its values are identical (returns false) or not (returns true)
#needed because if somebody runs multiple runs in deterministic case it would crash! #needed because if somebody runs multiple runs in deterministic case it would crash!
......
{"elementList": [{"_class": "Dream.Machine", "id": "M1", "results": {"working_ratio": 12.760416666666666, "blockage_ratio": 78.17708333333333, "failure_ratio": 9.027777777777779, "waiting_ratio": 0.034722222222222224}}, {"_class": "Dream.Machine", "id": "M2", "results": {"working_ratio": 76.31944444444444, "blockage_ratio": 0.0, "failure_ratio": 19.791666666666668, "waiting_ratio": 3.888888888888889}}, {"_class": "Dream.Exit", "id": "E1", "results": {"throughput": 732, "takt_time": 1.965846994535519, "lifespan": 7.646516393442623}}, {"_class": "Dream.Repairman", "id": "W1", "results": {"working_ratio": 26.73611111111111, "waiting_ratio": 73.26388888888889}}], "_class": "Dream.Simulation", "general": {"totalExecutionTime": 0.2929999828338623, "_class": "Dream.Configuration"}}
\ No newline at end of file
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