eclipse-sumo / sumo

Eclipse SUMO is an open source, highly portable, microscopic and continuous traffic simulation package designed to handle large networks. It allows for intermodal simulation including pedestrians and comes with a large set of tools for scenario creation.
https://eclipse.dev/sumo
Eclipse Public License 2.0
2.37k stars 1.37k forks source link

Allow dynamically adding personTrip (i.e. with "modes=taxi") #15154

Open JulianCzymmeck opened 3 days ago

JulianCzymmeck commented 3 days ago

Hi sumo team, I would like to convert (some of) my vehicles in a simulation to taxi customer pedestrians to simulate the effects of alternative traveling options, such as urban aerial mobility, on traffic in a large scale. Ideally I would like to do this during simulation time using traci and avoid writing new rou.xml files. The pedestrians should be functionally identical to the following xml definition:

<person id="converted_ped_xx" depart="0.00">
        <personTrip from="from_edge" to="to_edge" modes="taxi"/>
</person>

I can easily get and set the id, departure time and departure edge for the pedestrian I want to create, but I can't find a way to create a taxi customer with traci. I also struggle with adding the destination edge, since I don't want to append a walking stage, as I assume that this might not work with driving in a taxi. One more related question: Is it possible to further narrow down that the pedestrian should only use a certain type of taxi, as I use a custom vClass with a taxi device. When only specifying "modes=taxi" I am unable to use other taxi services is my simulation, as it would be unclear which service should be used.

Thank you!

namdre commented 3 days ago
JulianCzymmeck commented 3 days ago

Thank you for the quick response. One question regarding appending a driving stage: When adding a pedestrian to the simulation, given a starting edge, and then appending said driving stage with lines="taxi:uamFleet" and the very last edge of the trip, will the pedestrian walk to an edge/lane where taxis are permitted, and then drive as far as possible (and walk the rest of the way)? Or does appending a driving stage lock the pedestrian from walking. This is very relevant for my simulation, as the taxis I'm using are heavily restricted on where they are allowed. Additionally, if the taxi road network is far from the route from the starting point to the destination, would the pedestrian walk to the destination without interacting with the taxi network at all (this would be the desired behaviour)?

namdre commented 3 days ago

If you need walking in addition to taxi use, then appending a single driving stage won't work. Here is what you can do instead:

This will work as long as the pick-up and drop-off locations don't differ between the fleets.

JulianCzymmeck commented 1 hour ago

Unfortunately this suggested solution doesn't always work. It has the following issue: When calling traci.simulation.findIntermodalRoute(fromEdge=<edgeWithRestrictedAccess>, ... , modes="taxi"), for example if the starting edge is a pedestrian only edge, the following warning occurs: Warning: Ignoring vehicle type 'DEFAULT_TAXITYPE' when performing intermodal routing because it is not allowed on the start edge 'E14'. This results in only one stage (walking) getting generated, even though there is a section with taxi traffic in the middle. Furthermore, if the route to the destination is not reachable by foot (contains a section where pedestrians are disallowed and no sidewalk), but would have been reachable via taxi for example, an empty string gets returned.

For my specific use case thus this solution never works, as I always want the pedestrian to use an "aerial lane" where only uam taxis are allowed. Vehicle types getting ignored due to restrictions on the starting edge seems like an oversight / bug to me that could be relevant to others as well. Would it be possible to remove this restriction in the near future?

namdre commented 49 minutes ago

This does sound like a bug. I'll investigate.