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

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.

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.

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.

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)

Related

Cache simulation in gem5

Happy new year to everyone!
I want to know how to change caches' parameters in gem5. I usually use se.py configuration script for my simulations. Can I change caches's latencies in se.py? Is there an option for that?

How can I insert another model of antenna into the .NED of a traffic simulation?

I would like to introduce a Directional Antenna Model where I can change the gains of them so I can compare the results with the Default Omnidirectional Antenna (Isotropic Antenna) of the program.
I am using Veins 5.0, SUMO 0.19 and Omnet++ within the Github Carlogicapi found in https://github.com/burtonwilliamt/carlogicapi/blob/master/tutorials/VeinsTutorial/README.md
How can I do so?
Should I create a new model and then insert it? if so where should I insert it? directly in the .ini ?
how can I make omnet++ use the model I give him?
Here I have some useful links about the antenna's models I found in inet.omnetpp.org (https://inet.omnetpp.org/docs/showcases/wireless/directionalantennas/doc/)
would you give me a hand please?
inet.omnetpp
The Veins 5.0 tutorial simulation sets the antenna pattern to use in line 87 of its omnetpp.ini https://github.com/sommer/veins/blob/veins-5.0/examples/veins/omnetpp.ini#L87. It also comes with a variety of other (more or less directional) antenna patterns (namely panorama and patch), which are stored in other fragments of the same xml file: https://github.com/sommer/veins/blob/veins-5.0/examples/veins/antenna.xml

How to use user input in omnet++

I am using omnet++ for my experiment.
But, I want to experiment with my input not fixed input.
I do not know which API to use user input
How to use user input during simulation?
OMNeT++ simulations are written in C++, so you can use the full power of C++ libraries to read from files, the network, a gamepad, a kinect, etc to influence running simulations. Just create a simulation module that repeatedly reads data from such a source, e.g., once every simulated millisecond, then sends cMessages or changes modules' parameters in reaction to what it reads.

Omnet++: Parallelize Single Run Simulation

I'm trying to parallelize my model (I want to parallelize a single config run, not run multiple configs in parallel).
I'm using Omnet++ 4.2.2, but probably the version doesn't matter.
I've read the Parallel Distributed Simulation chapter of the Omnet++ manual
and the principle seems very straightforward:
simply assign different modules/submodules to different partitions.
Following the provided cqn example
*.tandemQueue[0]**.partition-id = 0
*.tandemQueue[1]**.partition-id = 1
*.tandemQueue[2]**.partition-id = 2
If I try to simulate relatively simple models everything works fine I can partition the model at wish.
However, when I start to run simulation that use Standardhost module, or modules that are interconnected using ethernet links that doesn't work anymore.
If i take for example the Inet provided example WiredNetWithDHCP (inet/examples/dhcp/eth), as experiment, lets say I want to run hosts in a different partition than the switch
I therefore assign the switch to a partition and everything else to another:
**.switch**.partition-id = 1
**.partition-id = 0
The different partitions are separated by links, there is delay, and therefore it should be possible to partition this way.
When I run the model, using the graphic interface, I can see that the model is correctly partitioned however the connections are somehow wrong and i get the following error message:
during network initialization: the input/output datarates differ
clearly datarates don't differ (and running the model sequentially works perfectly), by checking the error message this exception is triggered also by link not connected. This is indeed what happen. It seems that the gates are not correctly linked.
Clearly I'm missing something in the Link connection mechanism, should I partition somewhere else?
Due to the simplicity of the paradigm I feel like being an idiot but I'm not able to solve this issue by myself
Just to give a feedback,
It seems that directly it cannot be done, not the full INET as it is can be parallelized in short because it uses global variables in some places.
in this particular case, mac addresses assignment are one of the issues (uses a global variable), hence eth interface cannot be parallelized.
for more details refer to this paper explaining why this is not possible:
Enabling Distributed Simulation of OMNeT++ INET Models:
For reference/possible solution refer to authors webpage from aachen university, where you can download a complete copy of omnet++ and INET that can be parallelized:
project overview and code

How do I take actions every step in Veins?

I am using Veins to implement a scenario in which I shall update a vehicle's route every time step characterized by the step selfmsg. In which module shall I find this behavior? I want to add some more functions to this module in the application layer by extending it. Is it possible to do that?
You can take advantage of the fact that SUMO updates the positions of all vehicles at exactly the same time. By extension, Veins (I am assuming you are using version 4a2) will update the OMNeT++ positions of all vehicles at exactly the same time. See the Veins tutorial demo application for how to execute code whenever the position changes. Indeed, this will make sure that all code is running within in a single OMNeT++ event, which seems to be what you want.

Resources