Hi Daniel,
There is no built-in support to restrict the number of vehicles of a
certain vehicle type. However you can implement your custom logic in
TraCI to add/remove vehicles as you wish. Some methods which might turn
handy in this respect:
* Add a vehicle traci.vehicle.add
<https://sumo.dlr.de/pydoc/traci._vehicle.html#VehicleDomain-add>
* Remove a vehicle traci.vehicle.remove (see docs
<https://sumo.dlr.de/pydoc/traci._vehicle.html>)
* Get vehicles which departed in this time step
traci.simulation.getDepartedIDList
<https://sumo.dlr.de/pydoc/traci._simulation.html#SimulationDomain-getDepartedIDList>
* Get vehicled which arrived in this time step / left
traci.simulation.getArrivedIDList
<https://sumo.dlr.de/pydoc/traci._simulation.html#SimulationDomain-getArrivedIDList>
* Get the vehicle type of a vehicle traci.vehicle.getTypeID
<https://sumo.dlr.de/pydoc/traci._vehicle.html#VehicleDomain-getTypeID>
Do get to know more about TraCI in general, look here
<https://sumo.dlr.de/docs/index.html#traci_on-line_interaction>in the docs.
Best Regards
Mirko
Am 06.04.2022 um 12:21 schrieb Nyberg Daniel via sumo-user:
Hello!
Is there any way to restrict the number of vehicles for a certain
vehicle type?
Information:
I have different flowRoutes defined with different parameters for
desired vehicles per hour, and depending on the route I have assigned
different vehicle types. Thus, this will cause vehicles to enter the
simulation according to the assigned value for vehicles per hour.
But what I would like to do is to control the maximum number of
vehicles allowed in the simulation for each type.
The reason for this is because the situation I try to simulate have a
finite number of vehicles for each type, and the aim is to understand
if it will be possible to use these routes to satisfy the desired
number of vehicles per hour.
But when using the model described above a lot of vehicles will be
introduced which doesn’t exist in reality. Which in turn could cause
an unrealistic traffic situation.
Thank you in advance
Daniel Nyberg
_______________________________________________
sumo-user mailing list
[email protected]
To unsubscribe from this list,
visithttps://www.eclipse.org/mailman/listinfo/sumo-user
_______________________________________________
sumo-user mailing list
[email protected]
To unsubscribe from this list, visit
https://www.eclipse.org/mailman/listinfo/sumo-user