I modified the erlagen.rou.xml using duarouter to get the random routes for the vehicles. It looks like this:
<vehicle id="0" depart="0.00"><route edges="31401017#0 4006688#0 4006688#1 4006688#2 4006688#3 4006688#4 29900561#0 29900561#1 32270595 33174302#0 33174302#1 4686970#0 4686970#1 122161381 30350448 30350449 4047309 30751813 -35842306#1 -35842306#0 -4900741 -4900739#2 -4900739#1"/>
</vehicle>
<vehicle id="1" depart="1.00">
<route edges="19796637 122161381 30350448 8364476 30350450#0 30350450#1 30350450#2 4006702#0 31255203#0 -31241851#2 -31241851#1 -31241851#0 31241816#3 31241835#1 31241834#0"/>
</vehicle>
<vehicle id="2" depart="2.00">
<route edges="31401017#0 4006688#0 4006688#1 4006688#2 4006688#3 4006688#4 29900561#0 29900561#1 32270595 33174302#0 33174302#1 4686970#0 4686970#1 122161381 30350448 8364476 30350450#0 30350450#1 30350450#2 4006702#0 31255203#0 31255203#1"/>
</vehicle> .......
In the original erlangen.rou.xml of VEINS, I could control the number of vehicles either by using " *.manager.numVehicles" in the omnetpp.ini file or by using the "number =198" inside " erlangen.rou.xml". But when i use only 5 vehicles using " *.manager.numVehicles = 5" in omnetpp.ini file, there are multiple vehicles generated from the "erlangen.rou.xml". How can I use the desired number of vehicles.
Thank you.
Veins 4.6 creates a new network node for every (eligible) vehicle created by SUMO (where eligibility can be limited by vehicle type and region of interest).
In addition, the numVehicles parameter of the TraCIScenarioManager classes of Veins 4.6 takes care of ensuring that at least this many vehicles are present in a simulation after every time step (click here to see the source code responsible for this behavior).
Thus, the numVehicles parameter cannot be used to limit the number of vehicles. For this, either SUMO needs to be instructed to create fewer vehicles -- or SUMO needs to be instructed to define some routes but to create no vehicles at all (thus letting the numVehicles parameter take over creation of vehicles)
you can get approximate number of vehicles by increasing the end time in python command while you are generating the traffic in CMD like in following commands end time is 200 ,so you may get around 100 vehicles.
python c:\sumo\sumo25\tools\randomTrips.py -n map.net.xml -e 200 -l
python c:\sumo\sumo25\tools\randomTrips.py -n map.net.xml -r map.rou.xml -e 200 -l
Related
I am new to OMNET++ and I am working on vanet simulation using Simu5G cars example. I need to add another "eNodeB" to 3 "eNodeB"s and let them send messages at the same time to the car.
Any suggestions?
Thank you
I'm working on Veins | OMNeT++ | SUMO.
Is it possible to select the starting position of our cars and the destination?
I only see spawn of vehicules at the exact same position and don't know how to adapt them. I've already read some topics explaining that we have cars that are created automatically by the TraCI module, but how can we control it?
Cars are initially created by SuMO and then inserted in Veins by the TraCIScenarioManager. In the demo example from Veins, multiple vehicles are driving from the same origin to the same destination:
194 Cars leaving the Computer Science Building and campus of the University of Erlangen-Nuremberg
In order to have different traffic, you have to adjust the network description files of SuMO - in particular the *.rou.xml. See the SuMO wiki for how to configure vehicles and routes.
I think you can following method in TraCICommandInterface.h.
bool addVehicle(std::string vehicleId, std::string vehicleTypeId, std::string routeId, simtime_t emitTime_st = -DEPART_NOW, double emitPosition = -DEPART_POS_BASE, double emitSpeed = -DEPART_SPEED_MAX, int8_t emitLane = -DEPART_LANE_BEST_FREE);
Currently, I need to run SIPp scenario to simulate a large of call for loading test.
In the script of the caller, after receiving 200 OK message and before sending BYE message, I need to pause a duration to simulate for call duration as follows:
Caller:
Invite ------------->
...
200 OK <----------
ACK -------------->
pause milliseconds="xxx"
BYE -------------->
I need to generate random value for XXX to simulate for the different call durations which is similar to real calls.
I tried to generate random values in .csv file and get these values into caller script, but it's not successful. I get an error like this:
"Pause milliseconds, ... is not a floating point number!"
How can I generate a random value in a SIPp script?
From the SIPp reference document, which you may find a useful document for your future SIPp needs:
<pause distribution=> Indicates which statistical distribution to use
to determine the length of the pause. Without
GSL, you may use uniform or fixed. With
GSL, normal, exponential, gamma, lambda,
lognormal, negbin, (negative binomial), pareto,
and weibull are available. Depending on the
distribution you select, you must also supply
distribution specific parameters.
The following examples show the various types
of distributed pauses:
• <pause distribution="fixed" value="1000" /> pauses for 1
second.
• <pause distribution="uniform" min="2000" max="5000"/> pauses
between 2 and 5 seconds.
The remaining distributions require GSL. In
general the parameter names were chosen to
be as consistent with Wikipedia's distribution
description pages.
• <pause distribution="normal" mean="60000" stdev="15000"/> provides a normal pause with a mean of
60 seconds (i.e. 60,000 ms) and a standard
deviation of 15 seconds. The mean and
standard deviation are specified as integer
milliseconds.
I am using veins 3.0, witch connects SUMO 0.21.0 to OMNET++ 4.4.
In my simulation a new vehicle appear every 5 minutes at the begin of the road, drives on the road, and then leave the simulation. Sometimes it leaves the simulations earlier, if it had an "accident". So it doesn't drive 10 minutes long, but only some seconds for example.
In this case sometimes I have the situation, that there are no vehicles on the road: the old vehicles leaved the road and the new one didn't appear yet. My console output looks like this:
Node flow0.0 attention rate 0.999982
Node flow1.0 attention rate 0.999972
Node flow2.0 attention rate 0.999964
Node flow3.0 attention rate 0.999942
Node flow1.0 Vehicle slides off the road! with attention rate 0.999972 at time 1008.1
Node flow0.0 Vehicle slides off the road! with attention rate 0.999982 at time 1048.1
Node flow2.0 Vehicle slides off the road! with attention rate 0.999964 at time 1103.1
Node flow3.0 Vehicle slides off the road! with attention rate 0.999942 at time 1113.1
It shows every vehicle, that started the journey, and the moment, when it ended its journey. So you can see, that all vehicles departed at time 1113 seconds. Next vehicle will appear at time 1200 seconds.
In this case OMNET++ ignores, that in some minutes a new vehicle will appear and goes fast through the simulation till the end, because it has no more events. I receive the message:
Simulation time limit reached -- simulation stopped at event #15076, t=86400.
How can I let OMNET++ know, that a new vehicle will appear in some minutes? Now only SUMO has this information in its route file. Here I have 6 flows. Every flow sends a vehicle every 30 minutes. In summary every 5 minutes a new vehicle appears at the beginning of the road.
<flow id="flow0" type="vtype6" route="B470" begin="0" end="1209600" period="1800"/>
<flow id="flow1" type="vtype5" route="B470" begin="300" end="1209600" period="1800"/>
<flow id="flow2" type="vtype4" route="B470" begin="600" end="1209600" period="1800"/>
<flow id="flow3" type="vtype2" route="B470" begin="900" end="1209600" period="1800"/>
<flow id="flow4" type="vtype1" route="B470" begin="1200" end="1209600" period="1800"/>
<flow id="flow5" type="vtype0" route="B470" begin="1500" end="1209600" period="1800" />
As I understand, OMNET++ doesn't know anything about the future vehicles. How can I keep the simulation alive, until the next vehicle appear?
Thank you for your attention.
Try setting *.manager.autoShutdown = false in your omnetpp.ini.
In Veins 3, the TraCIScenarioManagerLaunchd module has a parameter bool autoShutdown = default(true) that determines whether to stop the module as soon as no more vehicles are in the simulation.
I generated plenty of routes (~90.000+) using SUMO's ACTIVITYGEN/DUAROUTER with a configuration file and different durations (--duration-d 1, --duration-d 7, ...).
The resulting .rou.xml is successfully executed by SUMO without serious errors. Just some warnings about invalid departPos.
But when using Veins, I receive the following error message:
<!> Error in module (Veins::TraCIScenarioManagerLaunchd)
Scenario.manager (id=6) at event #2327172, t=25619.2: Model error:
ASSERT: condition count == drivingVehicleCount false in function
processVehicleSubscription,
veins/modules/mobility/traci/TraCIScenarioManager.cc line 640.
I removed the ASSERT condition and displayed both values. count is always higher than drivingVehicleCount.
The included "veins" example is running without any problems.
I am using:
SUMO 0.22.0
OMNeT++ 4.6
Veins 4 alpha 2.
In addition, I tested Veins 3.0 and receive the same error message.
Did somebody encounter the same problem?
Commenting out the ASSERT is totally fine.
In SUMO any vehicle can have one of five states (according to statesvehicleStates_sm.uxf): first, it is loaded, transitions to running when it starts driving, then transitions to arrived when it arrived at its destination. In addition, running vehicles can temporarily become teleporting or parking.
Veins subscribes to these state changes to keep track of the number of driving vehicles. To make sure that the bookkeeping is correct, it compares its own count against SUMO's reported number of active vehicles.
I do not know why the numbers do not match sometimes. It only seems to occur in large congested networks.