OMNeT++ Simulation Library
5.6.1
|
#include <cscheduler.h>
Real-time scheduler class.
When installed as scheduler using the scheduler-class omnetpp.ini entry, it will synchronize simulation execution to real (wall clock) time.
Operation: a "base time" is determined when startRun() is called. Later on, the scheduler object calls usleep() from takeNextEvent() to synchronize the simulation time to real time, that is, to wait until the current time minus base time becomes equal to the simulation time. Should the simulation lag behind real time, this scheduler will try to catch up by omitting sleep calls altogether.
Scaling is supported via the realtimescheduler-scaling omnetpp.ini entry. For example, if it is set to 2.0, the simulation will try to execute twice as fast as real time.
Public Member Functions | |
cRealTimeScheduler () | |
virtual | ~cRealTimeScheduler () |
virtual std::string | str () const override |
virtual void | executionResumed () override |
virtual cEvent * | guessNextEvent () override |
virtual cEvent * | takeNextEvent () override |
virtual void | putBackEvent (cEvent *event) override |
Public Member Functions inherited from cScheduler | |
cScheduler () | |
virtual | ~cScheduler () |
virtual void | setSimulation (cSimulation *_sim) |
cSimulation * | getSimulation () const |
virtual void | endRun () |
Public Member Functions inherited from cObject | |
cObject () | |
cObject (const cObject &other) | |
virtual | ~cObject () |
virtual const char * | getClassName () const |
virtual const char * | getName () const |
bool | isName (const char *s) const |
virtual const char * | getFullName () const |
virtual std::string | getFullPath () const |
const cObject * | getThisPtr () const |
virtual _OPPDEPRECATED std::string | info () const |
virtual _OPPDEPRECATED std::string | detailedInfo () const |
virtual cObject * | dup () const |
virtual void | parsimPack (cCommBuffer *buffer) const |
virtual void | parsimUnpack (cCommBuffer *buffer) |
virtual cObject * | getOwner () const |
virtual bool | isOwnedObject () const |
virtual void | forEachChild (cVisitor *v) |
cObject * | findObject (const char *name, bool deep=true) |
void | copyNotSupported () const |
Public Member Functions inherited from cISimulationLifecycleListener | |
virtual | ~cISimulationLifecycleListener () |
virtual void | listenerAdded () |
virtual void | listenerRemoved () |
Protected Member Functions | |
virtual void | startRun () override |
Protected Member Functions inherited from cScheduler | |
virtual void | lifecycleEvent (SimulationLifecycleEventType eventType, cObject *details) override |
Protected Member Functions inherited from cObject | |
virtual void | take (cOwnedObject *obj) |
virtual void | drop (cOwnedObject *obj) |
void | dropAndDelete (cOwnedObject *obj) |
Additional Inherited Members | |
Static Public Member Functions inherited from cISimulationLifecycleListener | |
static const char * | getSimulationLifecycleEventName (SimulationLifecycleEventType eventType) |
Constructor.
|
virtual |
Destructor.
|
overrideprotectedvirtual |
Called at the beginning of a simulation run.
Reimplemented from cScheduler.
|
overridevirtual |
Returns a description that depends on the parametrization of this class.
Reimplemented from cScheduler.
|
overridevirtual |
Recalculates "base time" from current wall clock time.
Reimplemented from cScheduler.
|
overridevirtual |
Returns the first event in the Future Event Set.
Implements cScheduler.
|
overridevirtual |
Scheduler function – it comes from cScheduler interface. This function synchronizes to real time: before returning the first event from the FES, it waits (using usleep()) until the real time reaches the time of that simulation event.
Implements cScheduler.
|
overridevirtual |
Puts back the event into the Future Event Set.
Implements cScheduler.