0

I'm implementing some attacks in veins and using Sumo I made a map and added all the 120(120 vehicles but during the simulation totally 30 vehicles must be in the map at the same time) vehicles I need, the problem is that all the vehicles are inserted but not departed at all. I want to have some sort of lifetime for vehicles and each stay for around 15 seconds. I would appreciate if someone help me with this problem.

Bests

h.bahar
  • 1
  • 2

3 Answers3

1

I don't know exactly what veins offers here but there is no automated way to tell sumo that a vehicle should leave after a certain amount of time. The only workaround I can think of is to check the time yourself and remove the vehicle with a script. As far as I can tell veins does not implement the remove function for a vehicle but you could set a new route which ends at the current edge using TraCICommandInterface::Vehicle::getRoadId and TraCICommandInterface::Vehicle::newRoute.

Michael
  • 3,510
  • 1
  • 11
  • 23
  • Thanks, as I'm new to Sumo and everything, I don't know how to do it, is there any helpful documentation or example? what about limiting the route a vehicle should take so it takes less time? in this case when we reduce the number of hops does it mean at the end of its route the node leaves? – h.bahar Oct 09 '21 at 13:04
  • I can just give you this link: https://veins.car2x.org/documentation/modules/#traci – Michael Oct 09 '21 at 20:40
1

One way I could think of would be to use the TraCICommandInterface::Vehicle::moveTo() or TraCICommandInterface::Vehicle::moveToXY() function in TraCI(We have to define the function in traciCommandInterface.CPP and .h files in veins).You can move the vehicle to a specific location( like the end of your road network ) based on specific conditions( like the 15 seconds time interval that was mentioned above).

Dark_Eagle
  • 31
  • 3
0

http://www.grc.upv.es/Software/oldsw/vacamobil.html

The above link has a solution for your scenario. The work tries to keep the number of cars a constant value during the simulation. meanNumberOfCars is the parameter to look at.

Pasha M.
  • 340
  • 1
  • 12