Update number of cars in veins

713 views Asked by At

I was wandering if I can change the number of cars in veins or is fixed? If so, which class in the code I can find the declaration of the number of cars?

3

There are 3 answers

1
pb772 On BEST ANSWER

If you use randomTrips.py to generate rou.xml you can specify the number of vehicles you want in your simulation. In this case a 50 vehicles rou.xml file will be created.

<SUMO_HOME>/tools/randomTrips.py -n input_net.net.xml -e 50 
0
Christoph Sommer On

Anything to do with vehicle movement in a Veins simulation (e.g., when a car starts, where it starts, how and where it drives, ...) is governed by the road traffic simulator SUMO. The SUMO simulator comes with an excellent tutorial (Hello SUMO) and an extensive online user manual, available on the documentation pages on the SUMO website. In brief, you want to change the .rou.xml file to change how many cars are driving.

0
prithvi shenoy On

In the .rou.xml file, update the flow parameter number. For example the following setting:

"flow id="flow0" type="vtype0" route="route0" begin="0" period="3" number="2"/"

will change the number of vehicles to 2