0

In omnetpp.ini, to end a simulation we specify:

sim-time-limit = 10s (say)

How to specify this in terms of number of events. Does OMNeT++ have a related parameter in built?

Jerzy D.
  • 6,707
  • 2
  • 16
  • 22
Pasha M.
  • 340
  • 1
  • 12

1 Answers1

0

No, OMNeT++ does not have ready to use parameter to stop a simulation after specified number of events.
However, it is possible to achieve that behaviour programmatically, by adding the following piece of code to every handleMessage():

if (getSimulation()->getEventNumber() > 20000) {
    endSimulation();
}
Jerzy D.
  • 6,707
  • 2
  • 16
  • 22
  • 1
    Probably it would be better to implement a custom scheduler and use that. In that case you would not have to insert the above code in each module's handle message. – Rudi Mar 04 '22 at 10:54