#include <cscheduler.h>
Inheritance diagram for cScheduler:
See description of getNextEvent() for more info.
To switch to your own scheduler class (reasons you'd like to do that include real-time simulation, hardware-in-the-loop simulation, distributed (federated) simulation, parallel distributed simulation), subclass cScheduler, register your new class with the Register_Class() macro, then add the following to omnetpp.ini
:
[General] scheduler-class="MyClass"
Public Member Functions | |
cScheduler () | |
virtual | ~cScheduler () |
virtual void | setSimulation (cSimulation *_sim) |
virtual void | startRun ()=0 |
virtual void | endRun ()=0 |
virtual void | executionResumed () |
virtual cMessage * | getNextEvent ()=0 |
|
Constructor.
|
|
Destructor.
|
|
Called at the end of a simulation run.
Implemented in cSequentialScheduler, and cRealTimeScheduler. |
|
Called every time the user hits the Run button in Tkenv. Real-time schedulers (e.g. cRealTimeScheduler) may make use this callback to pin current simulation time to current wall clock time. Reimplemented in cRealTimeScheduler. |
|
The scheduler function -- it should return the next event to be processed. Normally (with sequential execution) it just returns msgQueue.peekFirst(). With parallel and/or real-time simulation, it is also the scheduler's task to synchronize with real time and/or with other partitions. If there's no more event, it throws cTerminationException. A NULL return value means that there's no error but execution was stopped by the user (e.g. with STOP button on the GUI) while getNextEvent() was waiting for external synchronization. Implemented in cSequentialScheduler, and cRealTimeScheduler. |
|
Pass cSimulation object to scheduler.
|
|
Called at the beginning of a simulation run.
Implemented in cSequentialScheduler, and cRealTimeScheduler. |