4

I modified the erlagen.rou.xml using duarouter to get the random routes for the vehicles. It looks like this:

    <vehicle id="0" depart="0.00"><route edges="31401017#0 4006688#0 4006688#1 4006688#2 4006688#3 4006688#4 29900561#0 29900561#1 32270595 33174302#0 33174302#1 4686970#0 4686970#1 122161381 30350448 30350449 4047309 30751813 -35842306#1 -35842306#0 -4900741 -4900739#2 -4900739#1"/>
</vehicle>
<vehicle id="1" depart="1.00">
    <route edges="19796637 122161381 30350448 8364476 30350450#0 30350450#1 30350450#2 4006702#0 31255203#0 -31241851#2 -31241851#1 -31241851#0 31241816#3 31241835#1 31241834#0"/>
</vehicle>
<vehicle id="2" depart="2.00">
    <route edges="31401017#0 4006688#0 4006688#1 4006688#2 4006688#3 4006688#4 29900561#0 29900561#1 32270595 33174302#0 33174302#1 4686970#0 4686970#1 122161381 30350448 8364476 30350450#0 30350450#1 30350450#2 4006702#0 31255203#0 31255203#1"/>
</vehicle>  .......

In the original erlangen.rou.xml of VEINS, I could control the number of vehicles either by using " *.manager.numVehicles" in the omnetpp.ini file or by using the "number =198" inside " erlangen.rou.xml". But when i use only 5 vehicles using " *.manager.numVehicles = 5" in omnetpp.ini file, there are multiple vehicles generated from the "erlangen.rou.xml". How can I use the desired number of vehicles.

Thank you.

  • Is there a chance you could make your question easier to read? I find it hard to grasp the problem – Christoph Sommer Sep 20 '17 at 11:45
  • Sorry for the inconvenience. Actually, I used Duaroute for making erlangen.rou.xml which makes random route edges. In the original erlangen.rou.xml of VEINS, I could control the number of vehicles either by using " *.manager.numVehicles" from the omnetpp.ini file or by using the "number =" inside " erlangen.rou.xml". But when i use only 5 vehicle like " *.manager.numVehicles = 5" in omnetpp.ini file, there are multiple vehicles generated from the "erlangen.rou.xml". How can I limit the vehilces numbers in this case. Thank you. –  Sep 20 '17 at 14:13

2 Answers2

3

Veins 4.6 creates a new network node for every (eligible) vehicle created by SUMO (where eligibility can be limited by vehicle type and region of interest).

In addition, the numVehicles parameter of the TraCIScenarioManager classes of Veins 4.6 takes care of ensuring that at least this many vehicles are present in a simulation after every time step (click here to see the source code responsible for this behavior).

Thus, the numVehicles parameter cannot be used to limit the number of vehicles. For this, either SUMO needs to be instructed to create fewer vehicles -- or SUMO needs to be instructed to define some routes but to create no vehicles at all (thus letting the numVehicles parameter take over creation of vehicles)

Christoph Sommer
  • 6,893
  • 1
  • 17
  • 35
  • I am confused by how `numVehicles` parameter is used when inserting new vehicles. You mentioned "at least this many vehicles are present in a simulation after every time step ". So, if numVehicles is 1000, and update interval is 1s, does that mean 1000 vehicles are inserted every 1s? I guess that shouldn't be the case, but then how I should correct understand this? Thanks. – J.G Apr 11 '18 at 20:58
  • 2
    Let's assume numVehicles is 10 and there are 10 vehicles in the simulation. We now advance to the next time step. Let's further assume that 5 vehicles arrived at their destination in this time step and 2 were planned to start a new trip (defined in the rou.xml file). Veins will realize that this is too little to fulfill your demand of numVehicles=10 and start 3 more in the next time step, bringing the total number of vehicles in the simulation back up to 10. – Christoph Sommer Apr 13 '18 at 00:45
  • So the `numVehicles` determines the total number of vehicles guaranteed to be in the simulation. By default it is 0, which indicates the simulation will just follow the setting in the SUMO. Is my understanding correct? – J.G Apr 13 '18 at 00:49
  • In this case, what is the default configuration of vehicles/nodes created by Veins, such as departSpeed, maxSpeed, departLane, etc.? And how can we customize these settings? – J.G Apr 13 '18 at 23:23
0

you can get approximate number of vehicles by increasing the end time in python command while you are generating the traffic in CMD like in following commands end time is 200 ,so you may get around 100 vehicles. python c:\sumo\sumo25\tools\randomTrips.py -n map.net.xml -e 200 -l
python c:\sumo\sumo25\tools\randomTrips.py -n map.net.xml -r map.rou.xml -e 200 -l

user12345
  • 55
  • 9
  • I think you meant adding the --period option when using randomTrips.py https://sumo.dlr.de/docs/Tools/Trip.html#traffic_volume_arrival_rate – Fady Samann Jun 10 '22 at 21:30