Martin Li
Martin Li

Reputation: 31

Questions regarding changing vehicle speed in SUMO through OMNet++ TraCI

I am currently using SUMO-0.19.0 veins-3.0 and OMNet++-4.6.

I have been doing research online about how to change the vehicle's speed through the ini file in OMNet, my goal is to test how different vehicle speed can affect the broadcast. I am able to change the broadcast interval using iteration, and I am able to change the vehicle speed in the .rou file and .net file one at a time.

However, my problem is I want to use iteration in OMNet++ ini file to change the vehicle speed and acceleration to accelerate the simulation process, but I don't know how.

I have checked the link https://groups.google.com/forum/#!topic/omnetpp/Cy1Slhx9h1U, but I still don't know where to use setSpeed, not to mention how to use iteration on changing the vehicle speed.

Thank you in advance.

Upvotes: 3

Views: 1571

Answers (3)

Raja Sattiraju
Raja Sattiraju

Reputation: 1272

If you are using traci interface, you can set any individualy vehicle speed from the next timestep using the command

traci.vehicle.setSpeed(vehId, desiredspeed)

Upvotes: 0

Natasha Baloch
Natasha Baloch

Reputation: 21

in my opinion the speed of the vehicles could be changed from the .net.xml file. the only problem is you have to change the speed separately for all the vehicles. the easiest way for that could be changing the speed of the group of vehicles like a group of cars have been classified as , u can replace the speed with any speed of your choice.

Upvotes: 0

floxyz
floxyz

Reputation: 686

To have runs with different vehicle speeds it is best to configure a run for every needed speed in SUMO.

To do this you have to create additional .rou.xml files with various speeds. How this can be achieved is described in detail in the SUMO Wiki. Basically, every .rou.xml has to have its own value for maxSpeed.

Afterwards make sure to load the correct .sumo.cfg via the .launchd.xmlin your omnetpp.ini. You can configure OMNeT++ to make a run for various configurations as shown in the OMNeT++ Manual.

Upvotes: 2

Related Questions