Commit 07faf48f authored by Georgios Dagkakis's avatar Georgios Dagkakis Committed by Jérome Perrin

Job updated to output shcedule as list of JSON objects in the result

parent 0fb1e98b
......@@ -68,12 +68,13 @@ class Job(Entity): # inherits from the Entity c
delay=completionTime-self.dueDate
json['results']['delay']=delay
json['results']['schedule']={}
json['results']['schedule']=[]
i=0
for record in self.schedule:
json['results']['schedule'][str(i)]={} # dictionary holding time and
json['results']['schedule'][str(i)]['stationId']=record[0].id # id of the Object
json['results']['schedule'][str(i)]['entranceTime']=record[1] # time entering the Object
json['results']['schedule'].append({}) # dictionary holding time and
json['results']['schedule'][i]['stepNumber']=i #the step number
json['results']['schedule'][i]['stationId']=record[0].id # id of the Object
json['results']['schedule'][i]['entranceTime']=record[1] # time entering the Object
i+=1
G.outputJSON['elementList'].append(json)
......
......@@ -14,28 +14,33 @@
"id": "J1",
"results": {
"completionTime": 50.0,
"schedule": {
"1": {
"schedule": [
{
"entranceTime": 0,
"stationId": "M1"
"stationId": "Q1",
"stepNumber": 0
},
"0": {
{
"entranceTime": 0,
"stationId": "Q1"
},
"3": {
"entranceTime": 30.0,
"stationId": "M3"
"stationId": "M1",
"stepNumber": 1
},
"2": {
{
"entranceTime": 10.0,
"stationId": "Q3"
"stationId": "Q3",
"stepNumber": 2
},
"4": {
{
"entranceTime": 30.0,
"stationId": "M3",
"stepNumber": 3
},
{
"entranceTime": 50.0,
"stationId": "E1"
}
"stationId": "E1",
"stepNumber": 4
}
]
}
},
{
......@@ -43,28 +48,33 @@
"id": "J2",
"results": {
"completionTime": 54.0,
"schedule": {
"1": {
"schedule": [
{
"entranceTime": 0,
"stationId": "M2"
"stationId": "Q2",
"stepNumber": 0
},
"0": {
{
"entranceTime": 0,
"stationId": "Q2"
"stationId": "M2",
"stepNumber": 1
},
"3": {
{
"entranceTime": 20.0,
"stationId": "M1"
"stationId": "Q1",
"stepNumber": 2
},
"2": {
{
"entranceTime": 20.0,
"stationId": "Q1"
"stationId": "M1",
"stepNumber": 3
},
"4": {
{
"entranceTime": 54.0,
"stationId": "E1"
}
"stationId": "E1",
"stepNumber": 4
}
]
}
},
{
......@@ -72,28 +82,33 @@
"id": "J3",
"results": {
"completionTime": 74.0,
"schedule": {
"1": {
"schedule": [
{
"entranceTime": 0,
"stationId": "M3"
"stationId": "Q3",
"stepNumber": 0
},
"0": {
{
"entranceTime": 0,
"stationId": "Q3"
},
"3": {
"entranceTime": 54.0,
"stationId": "M1"
"stationId": "M3",
"stepNumber": 1
},
"2": {
{
"entranceTime": 30.0,
"stationId": "Q1"
"stationId": "Q1",
"stepNumber": 2
},
{
"entranceTime": 54.0,
"stationId": "M1",
"stepNumber": 3
},
"4": {
{
"entranceTime": 74.0,
"stationId": "E1"
}
"stationId": "E1",
"stepNumber": 4
}
]
}
},
{
......
......@@ -14,36 +14,43 @@
"id": "J1",
"results": {
"completionTime": 6.0,
"schedule": {
"1": {
"schedule": [
{
"entranceTime": 0,
"stationId": "M1"
"stationId": "Q1",
"stepNumber": 0
},
"0": {
{
"entranceTime": 0,
"stationId": "Q1"
"stationId": "M1",
"stepNumber": 1
},
"3": {
{
"entranceTime": 1.0,
"stationId": "M3"
"stationId": "Q3",
"stepNumber": 2
},
"2": {
{
"entranceTime": 1.0,
"stationId": "Q3"
"stationId": "M3",
"stepNumber": 3
},
"5": {
{
"entranceTime": 4.0,
"stationId": "M2"
"stationId": "Q2",
"stepNumber": 4
},
"4": {
{
"entranceTime": 4.0,
"stationId": "Q2"
"stationId": "M2",
"stepNumber": 5
},
"6": {
{
"entranceTime": 6.0,
"stationId": "E1"
}
"stationId": "E1",
"stepNumber": 6
}
]
}
},
{
......
......@@ -14,36 +14,43 @@
"id": "J1",
"results": {
"completionTime": 6.0,
"schedule": {
"1": {
"schedule": [
{
"entranceTime": 0,
"stationId": "M1"
"stationId": "Q1",
"stepNumber": 0
},
"0": {
{
"entranceTime": 0,
"stationId": "Q1"
"stationId": "M1",
"stepNumber": 1
},
"3": {
{
"entranceTime": 1.0,
"stationId": "M3"
"stationId": "Q3",
"stepNumber": 2
},
"2": {
{
"entranceTime": 1.0,
"stationId": "Q3"
"stationId": "M3",
"stepNumber": 3
},
"5": {
{
"entranceTime": 4.0,
"stationId": "M2"
"stationId": "Q2",
"stepNumber": 4
},
"4": {
{
"entranceTime": 4.0,
"stationId": "Q2"
"stationId": "M2",
"stepNumber": 5
},
"6": {
{
"entranceTime": 6.0,
"stationId": "E1"
}
"stationId": "E1",
"stepNumber": 6
}
]
}
},
{
......@@ -51,36 +58,43 @@
"id": "J2",
"results": {
"completionTime": 13.0,
"schedule": {
"1": {
"schedule": [
{
"entranceTime": 0,
"stationId": "M2"
"stationId": "Q2",
"stepNumber": 0
},
"0": {
{
"entranceTime": 0,
"stationId": "Q2"
},
"3": {
"entranceTime": 4.0,
"stationId": "M3"
"stationId": "M2",
"stepNumber": 1
},
"2": {
{
"entranceTime": 3.0,
"stationId": "Q3"
"stationId": "Q3",
"stepNumber": 2
},
"5": {
"entranceTime": 6.0,
"stationId": "M2"
{
"entranceTime": 4.0,
"stationId": "M3",
"stepNumber": 3
},
"4": {
{
"entranceTime": 5.0,
"stationId": "Q2"
"stationId": "Q2",
"stepNumber": 4
},
"6": {
{
"entranceTime": 6.0,
"stationId": "M2",
"stepNumber": 5
},
{
"entranceTime": 13.0,
"stationId": "E1"
}
"stationId": "E1",
"stepNumber": 6
}
]
}
},
{
......
......@@ -15,36 +15,43 @@
"results": {
"delay": 8.0,
"completionTime": 23.0,
"schedule": {
"1": {
"schedule": [
{
"entranceTime": 0,
"stationId": "M1"
"stationId": "Q1",
"stepNumber": 0
},
"0": {
{
"entranceTime": 0,
"stationId": "Q1"
"stationId": "M1",
"stepNumber": 1
},
"3": {
{
"entranceTime": 1.0,
"stationId": "M3"
"stationId": "Q3",
"stepNumber": 2
},
"2": {
{
"entranceTime": 1.0,
"stationId": "Q3"
},
"5": {
"entranceTime": 19.0,
"stationId": "M2"
"stationId": "M3",
"stepNumber": 3
},
"4": {
{
"entranceTime": 4.0,
"stationId": "Q2"
"stationId": "Q2",
"stepNumber": 4
},
{
"entranceTime": 19.0,
"stationId": "M2",
"stepNumber": 5
},
"6": {
{
"entranceTime": 23.0,
"stationId": "E1"
}
"stationId": "E1",
"stepNumber": 6
}
]
}
},
{
......@@ -53,36 +60,43 @@
"results": {
"delay": 9.0,
"completionTime": 19.0,
"schedule": {
"1": {
"entranceTime": 2.0,
"stationId": "M2"
},
"0": {
"schedule": [
{
"entranceTime": 0,
"stationId": "Q2"
"stationId": "Q2",
"stepNumber": 0
},
"3": {
"entranceTime": 5.0,
"stationId": "M3"
{
"entranceTime": 2.0,
"stationId": "M2",
"stepNumber": 1
},
"2": {
{
"entranceTime": 5.0,
"stationId": "Q3"
"stationId": "Q3",
"stepNumber": 2
},
"5": {
"entranceTime": 12.0,
"stationId": "M2"
{
"entranceTime": 5.0,
"stationId": "M3",
"stepNumber": 3
},
"4": {
{
"entranceTime": 6.0,
"stationId": "Q2"
"stationId": "Q2",
"stepNumber": 4
},
"6": {
{
"entranceTime": 12.0,
"stationId": "M2",
"stepNumber": 5
},
{
"entranceTime": 19.0,
"stationId": "E1"
}
"stationId": "E1",
"stepNumber": 6
}
]
}
},
{
......@@ -91,28 +105,33 @@
"results": {
"delay": -1.0,
"completionTime": 5.0,
"schedule": {
"1": {
"schedule": [
{
"entranceTime": 0,
"stationId": "M2"
"stationId": "Q2",
"stepNumber": 0
},
"0": {
{
"entranceTime": 0,
"stationId": "Q2"
},
"3": {
"entranceTime": 4.0,
"stationId": "M3"
"stationId": "M2",
"stepNumber": 1
},
"2": {
{
"entranceTime": 2.0,
"stationId": "Q3"
"stationId": "Q3",
"stepNumber": 2
},
"4": {
{
"entranceTime": 4.0,
"stationId": "M3",
"stepNumber": 3
},
{
"entranceTime": 5.0,
"stationId": "E1"
}
"stationId": "E1",
"stepNumber": 4
}
]
}
},
{
......@@ -121,20 +140,23 @@
"results": {
"delay": 3.0,
"completionTime": 12.0,
"schedule": {
"1": {
"entranceTime": 5.0,
"stationId": "M2"
},
"0": {
"schedule": [
{
"entranceTime": 0,
"stationId": "Q2"
"stationId": "Q2",
"stepNumber": 0
},
"2": {
{
"entranceTime": 5.0,
"stationId": "M2",
"stepNumber": 1
},
{
"entranceTime": 12.0,
"stationId": "E1"
}
"stationId": "E1",
"stepNumber": 2
}
]
}
},
{
......
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