0

I've adapted the basic example of Veins (Erlangen example) and extended the number of vehicles to 2500 in the rou file. Additionaly, I implemented some more accidents and rerouting.

When I execute the simulation, there are not 2500 but 2510 vehicles over the course of the simulation. Why does this happen and how can I prevent that?

  • Possible duplicate of: [Why the number of vehicles are not increased in veins?](https://stackoverflow.com/questions/68181848/why-the-number-of-vehicles-are-not-increased-in-veins), (But not enough info give to be sure ... ) – Luuk Jan 28 '23 at 15:46
  • No, that is something different. As I've written, I increased the number of vehicles to 2500 (in that line of code mentioned in the question you linked). But instead of 2500 vehicles, 2510 vehicles will be spawned in the simulation – KarlderKleine Jan 29 '23 at 08:22

1 Answers1

0

Change number to 2500:

<routes>
    ...
    <flow id="flow0" ... number="2500"/>
    ...
</routes>

Then use duarouter utility to generate your routes:

duarouter -n erlangen.net.xml -r erlangen.rou.xml --randomize-flows -o erlangen.new_rou.xml

Finally replace erlangen.rou.xml with erlangen.new_rou.xml in erlangen.launchd.xml

gehirndienst
  • 424
  • 2
  • 13
  • Thanks for the reply. That is a way to fix it. However, I still don't understand **why** this happens in the first place. – KarlderKleine Feb 07 '23 at 17:35
  • I experienced that as well, that's why I always prefer to generate individual trips with duarouter instead of defining a flow, if I have a specific amount of vehicles in my scenario. – gehirndienst Feb 08 '23 at 14:09