Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [sumo-user] Number of cars entering and leaving region

Hello,
there is currently no high-level TraCI function to perform this kind of regional tracking.
You can use low-level functions such as traci.edge.getLastStepVehicleIDs().
By putting the vehicles on your observation edges in a list (or set) in every time step and comparing with the set from the previous step you can detect which vehicles have left the observation region.
You can also use the subscription feature to retrieve the relevant vehicle ids automatically in every simulation step (https://sumo.dlr.de/docs/TraCI/Interfacing_TraCI_from_Python.html#subscriptions)

regards,
Jakob

Am Do., 20. Feb. 2020 um 15:42 Uhr schrieb Taylor Oliveira <taylor.foreclipse@xxxxxxxxx>:
Hi all,

I am trying to get the number of cars entering and leaving a region (defined by a set of traffic lights) at each simulation step using TraCI. For example, in the attached figure, find out how many cars enter and exit by n0, n1, ... w0 and w1.

I thought about using induction loops, but I believe it would be a limiter when implementing a large-scale scenario.

Would anyone have any other ideas?

Thank you and best regards,
Taylor
_______________________________________________
sumo-user mailing list
sumo-user@xxxxxxxxxxx
To change your delivery options, retrieve your password, or unsubscribe from this list, visit
https://www.eclipse.org/mailman/listinfo/sumo-user

Back to the top