Commit b2353640 authored by Ioannis Papagiannopoulos's avatar Ioannis Papagiannopoulos Committed by Jérome Perrin

on initialize of Jobs, currentStation check and remainingRoute update

parent 77f2539a
......@@ -105,6 +105,16 @@ class Job(Entity): # inherits from the Entity c
# initializes all the Entity for a new simulation replication
# =======================================================================
def initialize(self):
if self.currentStation:
for step in self.route:
stepObjectIds=step.get('stationIdsList',[])
if self.currentStation.id in stepObjectIds:
ind=self.route.index(step)
self.remainingRoute = self.route[ind:]
break
else:
# has to be re-initialized each time a new Job is added
self.remainingRoute=list(self.route)
# check the number of stations in the stationIdsList for the current step (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