Execute the OMNET++ simulations for different configuration automatically

228 Views Asked by At

I have an OMNET++ simulation model which I am interested to simulate more than once (4 different simulations in this case). I am running Omnet++ 6 now.

I have defined the configuration file as follows.

Here, I do run the simulation for every configuration i.e for the 60s, then re-run the model to calculate for 120s and so on,

Is there any optimal way to run all the configurations i.e (60s, 120s, and so on till the last configuration) and save the .sca, .vec result?

[General] #General Configuration
ned-path = .;../queueinglib
network = MM1
*.srv.capacity = 100
*.srv.serviceTime = exponential(1s/24)
*.srv.queueLength.result-recording-modes = +histogram
*.sink.lifeTime.result-recording-modes = +histogram
*.Service.responseTime.result-recording-modes = +mean
*.src.interArrivalTime = exponential(1s/20)

[Config Run_01]        #Specific Conguration1
extends=General
sim-time-limit = 60s
[Config Run_02]       #Specific Conguration2
extends=General
sim-time-limit = 120s
[Config Run_03]       #Specific Conguration3
extends=General
sim-time-limit = 60s
[Config Run_04]       #Specific Conguration4
extends=General
sim-time-limit = 120s`
1

There are 1 best solutions below

2
gehirndienst On

You can set mentioned parameters within a console command to run your simulation so that you may iterate over configurations in a bash or python script to run simulations with selected parameters either sequentially or parallel. Example for sequential runs that I often use:

./your_sim_exec -m -u CmdEnv -r $RUN_NUMBER -c $RUN_CONFIG --sim-time-limit=$TIME_LIMIT ...

you just need to define a list or a range for your bash variables and a loop to substitute them into a run command one-by-one or randomly. If you want a parallel (batch) execution, then it is the same mechanism but you need to use opp_runall, check here