Dear SUMO community, For my project I am using SUMO's ability to reroute traffic using traci. I started with looking at TraCi's functions for setting routes: traci.vehicle.setRoute() and traci.vehicle.setRouteID(). I thought both of these would have the same behaviour, but it turns out there are differences.
Both correctly alter the car's route and have it continue riding without any hiccups. However, I ran into problems regarding the output generated by rerouted cars. I build a script to clearly show these problems, but worry that that might be a bit large to copy/paste into this mail... In any case, take the scenario of a car driving route A -> B and, halfway through edge B, having its route changed to B -> C. If we use .setRoute() with a list of edge IDs, this works perfectly, correctly maintaining the distance driven so far by the vehicle. However, if the function .setRouteID() is used, the car correctly switches over to the new route, but in calculating its driven distance it is now also assumed the car was initiated with the route B -> C. The driven distance is incorrect. More concerning is the scenario of a car driving route B -> C and getting assigned the route A -> B -> C with set.RouteID(). The car, assuming it started at point A, now believes it drove more distance than it ever actually covered. I wonder if this is intended behaviour? Kind regards, Iris Bekker P.S. I also found a different glitch, I believe. Suppose John Doe is driving route A -> B. When he is halfway on B, we try to change the route with setRoute() to A -> B -> C. This correctly gives an error, as changing the route with setRoute() needs the new route to start at the edge JohnDoe is currently on. However, the error message created reads "Warning: Invalid route replacement for vehicle 'JohnDoe'. No connection between edge 'A' and edge 'A'." ------------------------------------------------------------------------------ _______________________________________________ sumo-user mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/sumo-user
