lcodeca / SUMOActivityGen

An Activity-based Multi-modal Mobility Scenario Generator for SUMO. This project is available in the Eclipse SUMO contributed tools section (https://github.com/eclipse/sumo/tree/master/tools/contributed) under the name SAGA (SUMO Activity GenerAtion).
Eclipse Public License 2.0
40 stars 25 forks source link

Fix intermodal home/primary edge selection for PT #46

Closed colton-nevs closed 1 year ago

colton-nevs commented 1 year ago

When selecting home/primary edges, traci.simulation.findIntermodalRoute() is used to see if the edges are reachable. When mode is public and no depart time is input, the function returns a walking route. This is then considered invalid by sumoutils.is_valid_route(), so PT route generation always fails.

See https://github.com/lcodeca/SUMOActivityGen/issues/45

Here, I just added a flag to the is_valid_route() function to give leniency (i.e., route is valid if it is reachable by ANY mode) only when mode is public. Note that this leniency is only given during this edge selection part.

lcodeca commented 1 year ago

This change is not solving the problem, it is just avoiding the error message. By definition, public requires a public transportation ride, and with this change, that requirement is violated.

You are right, findIntermodalRoute has changed, and it does not work anymore, but the solution is to refactor SAGA to actually guess a start time that would approximatively match the required arrival time, and use that as a departure time to find a real public route.

lcodeca commented 1 year ago

Colton, this https://github.com/lcodeca/SUMOActivityGen/pull/47 is the kind of fix required. I need more time for additional tests, but now that I'm on holiday, I have more time to look into it. I'll merge it soon.

lcodeca commented 1 year ago

I'm closing this PR cause i merged the change.