Commit 8917c0af authored by Georgios Dagkakis's avatar Georgios Dagkakis Committed by Sebastien Robin

stepNumber attribute added in the JSON notation of the route of the Jobs. This...

stepNumber attribute added in the JSON notation of the route of the Jobs. This way the route is read correctly no matter what the sequence of steps in the JSON tree is
parent 623b2daa
......@@ -92,6 +92,7 @@
"name": "Job1",
"route": [
{
"stepNumber": "0",
"stationId": "Q1",
"processingTime": {
"distributionType": "Fixed",
......@@ -99,6 +100,7 @@
}
},
{
"stepNumber": "1",
"stationId": "Q3",
"processingTime": {
"distributionType": "Fixed",
......@@ -106,6 +108,7 @@
}
},
{
"stepNumber": "2",
"stationId": "Q2",
"processingTime": {
"distributionType": "Fixed",
......@@ -113,7 +116,8 @@
}
},
{
"stationId": "E1",
"stepNumber": "3",
"stationId": "E1",
"processingTime": {
"distributionType": "Fixed",
"mean": "0"
......
......@@ -92,6 +92,7 @@
"name": "Job1",
"route": [
{
"stepNumber": "0",
"stationId": "Q1",
"processingTime": {
"distributionType": "Fixed",
......@@ -99,20 +100,23 @@
}
},
{
"stationId": "Q3",
"stepNumber": "1",
"stationId": "Q3",
"processingTime": {
"distributionType": "Fixed",
"mean": "3"
}
},
{
"stationId": "Q2",
"stepNumber": "2",
"stationId": "Q2",
"processingTime": {
"distributionType": "Fixed",
"mean": "2"
}
},
{
"stepNumber": "3",
"stationId": "E1",
"processingTime": {
"distributionType": "Fixed",
......@@ -126,28 +130,32 @@
"name": "Job2",
"route": [
{
"stationId": "Q2",
"stepNumber": "0",
"stationId": "Q2",
"processingTime": {
"distributionType": "Fixed",
"mean": "3"
}
},
{
"stationId": "Q3",
"stepNumber": "1",
"stationId": "Q3",
"processingTime": {
"distributionType": "Fixed",
"mean": "1"
}
},
{
"stationId": "Q2",
"stepNumber": "2",
"stationId": "Q2",
"processingTime": {
"distributionType": "Fixed",
"mean": "7"
}
},
{
"stationId": "E1",
"stepNumber": "3",
"stationId": "E1",
"processingTime": {
"distributionType": "Fixed",
"mean": "0"
......
......@@ -92,28 +92,32 @@
"name": "Job1",
"route": [
{
"stationId": "Q1",
"stepNumber": "0",
"stationId": "Q1",
"processingTime": {
"distributionType": "Fixed",
"mean": "1"
}
},
{
"stationId": "Q3",
"stepNumber": "1",
"stationId": "Q3",
"processingTime": {
"distributionType": "Fixed",
"mean": "3"
}
},
{
"stationId": "Q2",
"stepNumber": "2",
"stationId": "Q2",
"processingTime": {
"distributionType": "Fixed",
"mean": "2"
}
},
{
"stationId": "E1",
"stepNumber": "3",
"stationId": "E1",
"processingTime": {
"distributionType": "Fixed",
"mean": "0"
......@@ -126,28 +130,32 @@
"name": "Job2",
"route": [
{
"stationId": "Q2",
"stepNumber": "0",
"stationId": "Q2",
"processingTime": {
"distributionType": "Fixed",
"mean": "3"
}
},
{
"stationId": "Q3",
"stepNumber": "1",
"stationId": "Q3",
"processingTime": {
"distributionType": "Fixed",
"mean": "1"
}
},
{
"stationId": "Q2",
"stepNumber": "2",
"stationId": "Q2",
"processingTime": {
"distributionType": "Fixed",
"mean": "7"
}
},
{
"stationId": "E1",
"stepNumber": "3",
"stationId": "E1",
"processingTime": {
"distributionType": "Fixed",
"mean": "0"
......@@ -160,21 +168,24 @@
"name": "Job3",
"route": [
{
"stationId": "Q2",
"stepNumber": "0",
"stationId": "Q2",
"processingTime": {
"distributionType": "Fixed",
"mean": "2"
}
},
{
"stationId": "Q3",
"stepNumber": "1",
"stationId": "Q3",
"processingTime": {
"distributionType": "Fixed",
"mean": "1"
}
},
{
"stationId": "E1",
"stepNumber": "2",
"stationId": "E1",
"processingTime": {
"distributionType": "Fixed",
"mean": "0"
......@@ -187,14 +198,16 @@
"name": "Job4",
"route": [
{
"stationId": "Q2",
"stepNumber": "0",
"stationId": "Q2",
"processingTime": {
"distributionType": "Fixed",
"mean": "7"
}
},
{
"stationId": "E1",
"stepNumber": "1",
"stationId": "E1",
"processingTime": {
"distributionType": "Fixed",
"mean": "0"
......
......@@ -293,12 +293,15 @@ def createObjects():
name=element.get('name', 'not found')
JSONRoute=element.get('route', [])
route=[]
for i in range(len(JSONRoute)):
route.append(None)
for routeElement in JSONRoute:
stepNumber=int(routeElement.get('stepNumber', '0'))
nextId=routeElement.get('stationId', 'not found')
processingTime=routeElement.get('processingTime', 'not found')
distributionType=processingTime.get('distributionType', 'not found')
mean=int(processingTime.get('mean', 'not found'))
route.append([nextId, mean])
route[stepNumber]=[nextId, mean]
J=Job(id, name, route)
G.JobList.append(J)
G.WipList.append(J)
......
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