How do I take actions every step in Veins? - omnet++

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.

Related

clustring by RSU in veins

I'm going to do fuzzy clustering by RSU in veins.
For this purpose, I first created a module that inherits TraCIDemo11p and incorporated clustering codes in it.
Then I created a method in TraCIDemoRSU11p and I made an object from the clustering class in it, and then called the method of clustering. Of course, I also used " std::cout<<" to this part ,if this part of the code was executed I noticed.
I ran the program but unfortunately didn't see what I was writing on the " std::cout<<" and realized that this part of my code wasn't running.
I want to know where should I call my clustering class to do the cluster at the beginning of the simulation?
I need your answer to solve my problem
Thanks

Veins V2V only without RSU

Which of the Veins version uses vehicle to vehicle communication (car) only without RSU. The current veins uses RSU, any way to remove RSU and use V2V (CAR) only.
Many thanks
How to add and remove modules from a simulation is documented in the user manual and the topic of lesson one in the tic toc tutorial. From a quick look at the top level .ned file of the simulation you should also see the line where the RSU is instantiated. Simply delete this line.

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.
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)

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

creating a modified graphhopper instance with updated edge weights

How can I create multiple graphs each with their own set of edge weights? For example, NY area with edge weights at 12AM, 6AM, 12PM, etc.
How can I update a graph with changes and save my changes to be loaded later. Is this possible? Or is there another approach? My direction was to edit the weighting code on the github under the core docs. To use a previous S/O answer, regarding dynamic edge weights. Where does this code get placed?
Also, brand new to this project and have not used a project environment as such (maven?). Can someone give me some pointers on how to use the MyGraphhopper extended class with overridding methods? What environment would I need to install on OSX to see the similar core or web interface?
If the above is not possible via web interface, how could I run queries using the command line?
Thanks,

Resources