 |
Eclipse SUMO - Simulation of Urban MObility
|
Go to the documentation of this file.
38 : currentTimeStep(-1), myEvents() {}
62 if (currEvent.second < 0) {
63 currEvent.second = execTime;
65 if (currEvent.second < execTime +
DELTA_T) {
66 Command* command = currEvent.first;
70 time = command->
execute(execTime);
80 WRITE_WARNING(
"Command returned negative repeat number; will be deleted.");
82 delete currEvent.first;
84 currEvent.second += time;
virtual void addEvent(Command *operation, SUMOTime execTimeStep=-1)
Adds an Event.
#define WRITE_WARNING(msg)
void setCurrentTimeStep(SUMOTime time)
Set the current Time.
EventCont myEvents
Event-container, holds executable events.
std::pair< Command *, SUMOTime > Event
Combination of an event and the time it shall be executed at.
virtual SUMOTime execute(SUMOTime currentTime)=0
Executes the command.
virtual ~MSEventControl()
Destructor.
SUMOTime getCurrentTimeStep() const
Returns the current simulation step.
static MSNet * getInstance()
Returns the pointer to the unique instance of MSNet (singleton).
SUMOTime currentTimeStep
The current TimeStep.
bool isEmpty()
Returns whether events are in the que.
Base (microsim) event class.
MSEventControl()
Default constructor.
virtual void execute(SUMOTime time)
Executes time-dependant commands.
SUMOTime getCurrentTimeStep()
get the Current TimeStep used in addEvent.