Advice in Time simulation - omnet++

I just created VANET simulation with AODV protocol .. Then running it using omnet++ and sumo ..please your advice for :-
1- Which button it better to use ( run button , or fast button )
2- When I using the run button, my simulation take along time upto 12 hour with sample number of car .. So if the number of car increase it will take more long time, So how can increase the speed of simulation to get less run time ..
Thanks in advance

For running simulations (for collecting results and after verifying that your model works as intended) I recommend two things:
Run your simulation in release mode. This means compiling the code with the flag MODE=release. More details can be found in the OMNeT++ user manual.
Run your simulations on the command line - do not use any OMNeT++ GUI. If you want to collect results this is by far the fastest way as you do not care about the GUI. How to use the command line is explained in the dedicated OMNeT++ user manual section.

Related

OMShell Simulation Times Output

When I simulate an OpenModelica model using OMShell I got the following times as output:
timeFrontend
timeBackend
timeSimCode
timeTemplates
timeCompile
timeSimulation
timeTotal
I wasn't able to find any information about the meaning of each of them. Do you know the meaning of each of these times? Do you know some documentation that can help me figure this out?
OK, here it goes from the top of my head:
timeFrontend: the time it takes to flatten the Modelica code (remove structure and expand connects, etc) to get to a hybrid DAE
timeBackend: the time it takes to do a lot of symbolic manipulations to the system to bring it to ODE form (causalization, blt transformation, index reduction, matching, etc)
timeSimCode: time to generate the structures for code generation
timeTemplates: the time it takes to generate the C or C++ files from SimCode stuctures
timeCompile: the time it takes to compile the generated C or C++ files via gcc or clang into a simulation executable
timeSimulation: the time it takes to run the generated simulation executable to get the simulation results
timeTotal: duh :)

Veins Add Polygon to SUMO GUI

I am simulating a scenario where I want to add and/or delete polygon dynamically. However, when I tried to add a polygon, the system generates me below error;
<!> ASSERT: Condition 'result == RTYPE_OK' does not hold in function 'query' at veins/modules/mobility/traci/TraCIConnection.cc:119 -- in module (TraCIDemo11p) RSUExampleScenario.node[1].appl (id=14), at t=1.1s, event #12
I debug the code and I see that the TraciConnection does not return the RTYPE_OK. If I remove the assert statement, the code works fine. However, I want to learn the logic behind this.
I also see that the SUMO console give an error message. The code that I used to add polygon is;
traci->addPolygon(polyId, polyType, color, filled, layer, points);
Sumo: 0.32 Omnet: 5.4.1 Veins: 4.7
Any suggestion is appreciated. I am a starter on GUI related things. Sorry if the question does not make sense. Thanks.
Most likely SUMO refuses to add the polygon you requested. Maybe the ID you chose already exists in the simulation.
To find out why SUMO complains, you can change its source code to include debug output -- or you can run SUMO in a debugger.
To run SUMO in a debugger, the simplest solution is to switch from using TraCIScenarioManagerLaunchd to TraCIScenarioManager (probably by changing veins/nodes/Scenario.ned) and launching SUMO in a debugger manually (e.g. by running lldb sumo -- --remote-port 9999 -c erlangen.sumo.cfg)

How to implement time in Pari/GP

I have Pari/GP 32-bit and would like to implement any type of code which runs for a limited amount of time, then automatically stops if nothing is produced by that time. Here is a pseudocode example:
command
...
run command
if run time over 3 minutes
automatically interrupt the program and stop running
I know there is a basic way to do this, I just never found it in the PARI/GP guide. Any help? Thanks.
alarm(5);for(i=1,10^10,continue)

Multiple runs in omnet++ but with new network

I am trying to get different results for the code I have written in veins. I would like to run simulation multiple times to get average of all result. Issue I am facing is when I use repeat=5 i get exact same result in all 5 runs. I want to regenerate the network each time it repeats. I have written code to place RSUs in random positions but i get same result. What I can try?
Frist of all, see the TicToc Tutorial.
For your issue, you need to set a seed for each run as the OMNet Manual show
For me, the best way is set seed-set as the repetition number(repeat)
seed-set = ${repetition}
To start all repetitions of a simulation go to Run Configurations and set Cmdenv as User interface and:
for OMNeT++ 5.0 or older: set * (asterisk) in Runnumber
for OMNeT++ 5.1: set 0..4 in Run(s)
As a result you will obtain five set of results.
Optionally you can choose more than one processes to run in parallel or CPUs/processes to use in Run Configurations.

Real time image processing timing

I am using Arduino controller with MATLAB to build a system that reads in sensor data, which triggers a live feed camera to capture an image for real time image processing. Based on these results further processing is done "after some required delay" through controller. Now the problem I am facing is I cannot read sensor data until the last step of previous stage is completed. I want to be able to read sensor data continuosly and process images even while the last processing stage based on previous image is still executing (because of the delay provided). Thank you for any advice/help. Sorry if my english is bad I hope I'm clear.
You are asking about executing a Matlab code in asynchronous mode. As this maybe hard to control using parallel processes generated by matlabpool (e.g. parfor), you may consider writing your code as MPI. Through MPI you can assign the code lines to be run on each slave process while merging/timing the results can be controlled by the master process.

Resources