Real-time simulation

The word "real-time" means that the simulation is executed in a way such that simulation time is synchronized to real time: simulating one second in the model will also take one "real" second. This is in contrast to "normal" simulation, when we want the simulation to run as fast as possible.

To implement real-time simulation, one has to establish a relationship between real time and simulation. For example, one has to remember the date/time when the simulation was started as T0, and then arrange so that during simulation, an event with simulation time t gets executed at real time T0+t. Practically this means that just before executing every event, one needs to introduce some amount of waiting, using e.g. Unix usleep() calls. In OMNeT++/OMNEST, this waiting is embedded into the scheduler class. The Dyna/Real-Time example uses the cRealtimeScheduler class, and this one uses cSocketRealTimeScheduler which also takes care of other tasks necessary in hardware-in-the-loop simulation.

Home