Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [sumo-user] Alternative routes travel time

there is currently no direct way to retrieve this.
However, you can simply save the current route (list of edges) to a variable, reroute, retrieve the new list of edges, compare and then restore the old list of edges if the new route does not suite you.
To obtain the travel time for a list of edges you can call traci.edge.getTraveltime() for each of them.
Note, that this returns the travel time based on current mean speeds which may be quite volatile. In particular for edges ahead of traffic lights.

If the vehicle is equipped with a rerouting device, automated rerouting will use aggregated weights with a configurable aggregation method ( This overcomes the aforementioned volatility issue.
Using the very latest development version (25806) the corresponding travel times for the rerouting device may be retrieved ( However, it is currently not possible to trigger routing using these weights directly via TraCI. (see At the moment they are only used with automatic rerouting.


2017-09-03 2:48 GMT+02:00 Arezoo Samimi via sumo-user <sumo-user@xxxxxxxxxxxxxxxxxxxxx>:

Is there anyway to get the travel time of current and alternative routes
for each vehicle before rerouting using TraCI?

Check out the vibrant tech community on one of the world's most
engaging tech sites,!
sumo-user mailing list
sumo-user mailing list
To change your delivery options, retrieve your password, or unsubscribe from this list, visit

Back to the top