Set accident parameters of the vehicle - omnet++

where can I set the accident parameters of the vehicle except the omnetpp.ini in the example of veins.
I want to set the accident more stochastic.
It is complicated to do it.

Related

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 implement two radios in Veins?

I want to implement an protocol with two radios switched on different frequencies. Can I just add an additional PhyLayer80211p module in the Nic80211p module?
If so, how do I address them? If I see it correctly, the findModule method used in Mac1609_4.cc:37 has no attribute to specify which Phy-module he should return. That way i can't specify which of the two radios should be set to RadioState TX (as well as which frequency it is set to).
Would it differ automatically between the two channels if i just send a message two the right gate to the phyModule and set them on seperate frequencies before? e.g.
sendDelayed(mac, RADIODELAY_11P, lowerLayerOut); vs. sendDelayed(mac, RADIODELAY_11P, lowerControlLayerOut);
Any other tips? 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)

Transmission of vehicular status in Veins

I want to transmit a given car's vehicular data such as it's vType, instantaneous speed and position to a RSU in a scenario in Veins.
How can I obtain the data from SUMO and send it through MiXiM methods to an RSU node?
To achieve your goal you have to use the TraCIMobility component of Veins.
You can do that by first getting a pointer to that component in the initialize() method of your node
cModule *tmpMobility = getParentModule()->getSubmodule("veinsmobility");
mobility = dynamic_cast<Veins::TraCIMobility*>(tmpMobility);
ASSERT(mobility);
Once you have the mobility component you can query it for various data.
The type of data that it can provide can be found in TraCIMobility.h
For example in your case you could do:
mobility->getCurrentSpeed().length()); /* will provide velocity vector */
mobility->getAngleRad()); /* will provide angle of movement */
Then you can attach this data to your message and send it to the RSU of your choice.
If this exact solution does not work for you that could be due to me using a different Veins version than yours.
However you will certainly find what you need in TraCIDemo11p.cc or TraCIDemoRSU.cc of your Veins project.
Also, TraCICommandInterface is something you should have a look at.
In the official Veins website under the Documentation section it is said:
Application modules can use the TraCICommandInterface class and
related classes, conveniently accessible from TraCIMobility, to
interact with the running simulation. The following example shows how
to make a vehicle aware of slow traffic on a road called Second
Street, potentially causing it to change its route to avoid this road.
mobility = TraCIMobilityAccess().get(getParentModule());
traci = mobility->getCommandInterface();
traciVehicle = mobility->getVehicleCommandInterface();
traciVehicle->changeRoute("Second Street", 3600);
Some of the other vehicle related commands are setSpeed or setParking.
Similar methods are available for the whole simulation (e.g.,
addVehicle, addPolygon), roads (getMeanSpeed), individual lanes
(getShape), traffic lights (setProgram), polygons (setShape), points
of interest, junctions, routes, vehicle types, or the graphical user
interface.
How to use these modules is demonstrated in the source code of the
Veins tutorial example. Again, a list of all 80+ available methods can
be found in TraCICommandInterface.h or the autogenerated module
documentation.
A potentially related question/answer here: https://stackoverflow.com/a/29918148/4786271

Resources