Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[sumo-user] Know in advance the route to be covered

Hi,

I am performing a simulation using TraCI. In my simple scenario, I have two vehicles stopped at two respective edges, and I have a third target edge. I want to select the vehicle that is closer to the target and make it go there. To do so I would like to consider the distance to be covered or the time, but to keep things simple, at the moment it would be enough to count the number of edges to be covered. To do so I created the route and then used the function traci.route.getRoute to obtain the list of edges to be covered, count them and compare the two numbers so to select the lower one. The problem is that in the list only start and end edges appear so it always give me that edges to be covered are two.

How should I do to obtain the real number?
Is there a way to obtain the minimum distance between to edges or even the minimum time necessary to cover the route between them?


Thank you very much in advance for the answer

Stefano Niero


Back to the top