Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [sumo-user] Calculate number of vehicles ahead in the edge and lane

Hi Jakob,

And how do you know when an intersection has multiple edges?
So better than isStopped, is to use if speed is below some small value, that would mean that is stopped then or waiting at an intersection, right?

Best regards,
José

On Tue, 24 Jul 2018 at 15:34, Jakob Erdmann <namdre.sumo@xxxxxxxxx> wrote:
Hello,
this approach is possible.
You should probably continue across multiple edges until hitting a "real" intersection (one with multiple edges).
Note, that isStopped only returns true for scheduled stops. Vehicles that are waiting at an intersection can only be detected by having speed 0

regards,
Jakob

2018-07-24 16:30 GMT+02:00 Jose Monreal Bailey <jmonreal@xxxxxxxxx>:
Hi everyone,

I want to calculate the number of vehicles I have in front of a certain vehicle, this to calculate the number of vehicles moving and standing in front  of a vehicle.

I was thinking in using getLeader, to get all the vehicles in front, but this only returns one vehicle id.
What would be the best approach to calculate a standing queue of vehicles?
Iterate in the edge until there is no leader in that edge?

And to get the number of vehicles standing and moving, I was thinking in using for each of the leaders returned, isStopped to get the number of vehicles that are stopped and wich are not.

Is this the best approach, or would you recommend something better to do?

Best regards,
José

_______________________________________________
sumo-user mailing list
sumo-user@xxxxxxxxxxx
To change your delivery options, retrieve your password, or unsubscribe from this list, visit
https://dev.eclipse.org/mailman/listinfo/sumo-user


_______________________________________________
sumo-user mailing list
sumo-user@xxxxxxxxxxx
To change your delivery options, retrieve your password, or unsubscribe from this list, visit
https://dev.eclipse.org/mailman/listinfo/sumo-user

Back to the top