sumo icon indicating copy to clipboard operation
sumo copied to clipboard

Stop edge validation fails due to late loading of the current edge from state

Open m-kro opened this issue 1 year ago • 4 comments

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.

m-kro avatar Aug 14 '24 13:08 m-kro

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.

m-kro avatar Aug 16 '24 11:08 m-kro

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

m-kro avatar Aug 16 '24 12:08 m-kro

Test files at S:/Bugreports/15353

m-kro avatar Aug 19 '24 07:08 m-kro

some meso tests in sumo/extended/state broke after e32239b

namdre avatar Aug 26 '24 11:08 namdre

state loading is broken with e32239b (validated with input example from external customer)

namdre avatar Sep 04 '24 16:09 namdre

presumably fixed with #15503

namdre avatar Nov 07 '24 10:11 namdre