Stop edge validation fails due to late loading of the current edge from state
At the following point in the code, the stops are validated in terms of whether they can be reached on the downstream part of the vehicle's route.
https://github.com/eclipse-sumo/sumo/blob/c8697adec049034a01a0861b3e38b80bba8e296e/src/microsim/MSBaseVehicle.cpp#L1461-L1478
To me it seems some case has been forgotten:
- vehicle with multiple stops
- a specific edge is passed twice along the route: first time for reaching a previous stop, then for stopping exactly there
In this case the validation will fail because the stop edge has already been passed once, thus the stop edge can be found upstream of the current route position. It is not checked whether the edge can be found downstream as well.
Seems to be related to state loading and how the iterator to the current vehicle edge is initialised. By default, MSBaseVehicle::myCurrEdge is set to the first edge of the route. When the vehicle is loaded from a saved state, this may be wrong. Loading stops directly afterwards leads to a wrong search position inside the route.
Stops are loaded in MSRouteHandler::closeVehicle() before the actual state is in v->loadState(*myAttrs, myOffset):
https://github.com/eclipse-sumo/sumo/blob/63e50260eec22d0aef7702b50871635e2fabde0c/src/microsim/MSStateHandler.cpp#L457-L463
Test files at S:/Bugreports/15353
some meso tests in sumo/extended/state broke after e32239b
state loading is broken with e32239b (validated with input example from external customer)
presumably fixed with #15503