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.57k stars 1.43k forks source link

Different behaviour between adding routes via traci and xml files #15392

Closed afreymann closed 2 months ago

afreymann commented 2 months ago

Add your issue description here.

I am making a scenario with electric vehicles with a route from a to b. Using traci all is fine, the simulation runs, a route exists between these two edges and the vehicle drives to the second edge,

traci.route.add("3001", ["-468914851", "-387296022#0"]) traci.vehicle.add("1001", "3001", typeID="ev-default", depart=10)

However, using xml definition instead to add a route and a vehicle with the same parameters ... <route id="3001" edges="-468914851 -387296022#0"/> <vehicle id="1001" type="ev-default" route="3001" depart="10" />

... the vehicle stucks at the lane that is connected to the first edge. The route ends at the end of the lane (grey line)

grafik

I am not sure whats happening. I did the same settings in traci and within the xml definition. Is there anything that is do not see?

SUMO-version: 1.20

operating system: Lunix

namdre commented 2 months ago

sumo and duarouter distinguish between a "trip" (only start an end are given) and a "route" (all intermediate edges are given). If you want to define a trip in XML input, see https://sumo.dlr.de/docs/Definition_of_Vehicles%2C_Vehicle_Types%2C_and_Routes.html#incomplete_routes_trips_and_flows

Having TraCI interpret disconnected two-edge routes as trips is a convenience feature meant to simplify the TraCI API.