Commit 2f06bfea authored by Sebastien Robin's avatar Sebastien Robin

General: remove usage of stepNumber on routes

This information was only a duplicate of information. The stepNumber
is already available has the position of the step in the route list.
parent 39dbf389
......@@ -116,7 +116,6 @@ class Simulation(ACO.Simulation):
# two times Decomposition
predecessor_set = set()
route_list = []
route_counter = 0
for j, sequence_step in enumerate(sequence_list):
for predecessor_step in self.getNotMachineNodePredecessorList(sequence_step):
# We avoid having two time Decomposition in the route. XXX Is this correct ?
......@@ -124,12 +123,9 @@ class Simulation(ACO.Simulation):
continue
predecessor_set.add(predecessor_step)
route = {"stationIdsList": [predecessor_step],
"stepNumber": "%i" % route_counter
}
route_list.append(route)
route_counter += 1
route = {"stationIdsList": list(self.getMachineNameSet(sequence_step)),
"stepNumber": "%i" % route_counter,
"processingTime": {"distributionType": "Fixed",
"mean": "%i" % int(processing_time_list[j])},
"setupTime": {"setupDistribution": "Fixed",
......@@ -138,14 +134,6 @@ class Simulation(ACO.Simulation):
if prerequisite_list:
route["prerequisites"] = prerequisite_list
route_list.append(route)
route_counter += 1
"""
if sequence_step == "IM":
route_counter += 1
route_list.append({"stationIdsList": ["E1"],
"stepNumber": "%i" % route_counter})
route_counter += 1
"""
return route_list
def getListFromString(self, my_string):
......@@ -223,10 +211,6 @@ class Simulation(ACO.Simulation):
prerequisite_list)
if part_type == "Mould":
route_list = route_list[1:]
counter = 0
for route in route_list:
route["stepNumber"] = "%i" % counter
counter += 1
component_dict["route"] = route_list
i+=1
order_dict["componentsList"] = component_list
......
......@@ -1010,12 +1010,7 @@ def createWIP():
JSONRoute=entity.get('route', []) # dummy variable that holds the routes of the jobs
# the route from the JSON file
# is a sequence of dictionaries
route = [None for i in range(len(JSONRoute))] # variable that holds the argument used in the Job initiation
# hold None for each entry in the 'route' list
for routeentity in JSONRoute: # for each 'step' dictionary in the JSONRoute
stepNumber=int(routeentity.get('stepNumber', '0')) # get the stepNumber
route[stepNumber]=routeentity
route = [x for x in JSONRoute] # copy JSONRoute
# keep a reference of all extra properties passed to the job
extraPropertyDict = {}
......@@ -1075,12 +1070,7 @@ def createWIP():
JSONRoute=entity.get('route', []) # dummy variable that holds the routes of the jobs
# the route from the JSON file
# is a sequence of dictionaries
route = [None for i in range(len(JSONRoute))] # variable that holds the argument used in the Job initiation
# hold None for each entry in the 'route' list
for routeentity in JSONRoute: # for each 'step' dictionary in the JSONRoute
stepNumber=int(routeentity.get('stepNumber', '0')) # get the stepNumber
route[stepNumber]=routeentity
route = [x for x in JSONRoute] # copy JSONRoute
# keep a reference of all extra properties passed to the job
extraPropertyDict = {}
......@@ -1125,12 +1115,7 @@ def createWIP():
JSONRoute=entity.get('route', []) # dummy variable that holds the routes of the jobs
# the route from the JSON file
# is a sequence of dictionaries
route = [None for i in range(len(JSONRoute))] # variable that holds the argument used in the Job initiation
# hold None for each entry in the 'route' list
for routeentity in JSONRoute: # for each 'step' dictionary in the JSONRoute
stepNumber=int(routeentity.get('stepNumber', '0')) # get the stepNumber
route[stepNumber]=routeentity
route = [x for x in JSONRoute] # copy JSONRoute
# keep a reference of all extra properties passed to the job
extraPropertyDict = {}
......@@ -1198,12 +1183,7 @@ def createWIP():
JSONRoute=entity.get('route', []) # dummy variable that holds the routes of the jobs
# the route from the JSON file
# is a sequence of dictionaries
route = [None for i in range(len(JSONRoute))] # variable that holds the argument used in the Job initiation
# hold None for each entry in the 'route' list
for routeentity in JSONRoute: # for each 'step' dictionary in the JSONRoute
stepNumber=int(routeentity.get('stepNumber', '0')) # get the stepNumber
route[stepNumber]=routeentity
route = [x for x in JSONRoute] # copy JSONRoute
# keep a reference of all extra properties passed to the job
extraPropertyDict = {}
......
......@@ -39,7 +39,6 @@ as a dictionary with the following layout if the mould is not already in WIP
},
"route": [
{
"stepNumber": "0",
"stationIdsList": [
"MA1"
], # the mould assembly stations
......@@ -49,7 +48,6 @@ as a dictionary with the following layout if the mould is not already in WIP
}
},
{
"stepNumber": "1",
"stationIdsList": [
"IM1"
], # the injection moulding station
......@@ -219,11 +217,7 @@ class MouldAssembly(MachineManagedJob):
# dummy variable that holds the routes of the jobs the route from the JSON file is a sequence of dictionaries
JSONRoute=component.get('route', [])
# variable that holds the argument used in the Job initiation hold None for each entry in the 'route' list
route = [None for i in range(len(JSONRoute))]
for routeentity in JSONRoute: # for each 'step' dictionary in the JSONRoute
stepNumber=int(routeentity.get('stepNumber', '0')) # get the stepNumbe
route[stepNumber]=routeentity
route = [x for x in JSONRoute] # copy JSONRoute
# assert that the assembler is in the moulds route and update the initial step of the mould's route
firstStep = route.pop(0)
assert (self.id in firstStep.get('stationIdsList',[])),\
......
......@@ -214,11 +214,7 @@ class OrderDecomposition(CoreObject):
# dummy variable that holds the routes of the jobs the route from the JSON file is a sequence of dictionaries
JSONRoute=component.get('route', [])
# variable that holds the argument used in the Job initiation hold None for each entry in the 'route' list
route = [None for i in range(len(JSONRoute))]
for routeentity in JSONRoute: # for each 'step' dictionary in the JSONRoute
stepNumber=int(routeentity.get('stepNumber', '0')) # get the stepNumber
route[stepNumber]=routeentity
route = [x for x in JSONRoute]
# keep a reference of all extra properties passed to the job
extraPropertyDict = {}
......
......@@ -70,6 +70,7 @@ def format(m):
if 'route' in job:
for r in job['route']:
print r
r.pop("stepNumber", None)
if 'processingTime' in r:
processingTime = r['processingTime']
if 'mean' in processingTime:
......
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