41 #ifdef CHECK_MEMORY_LEAKS 43 #endif // CHECK_MEMORY_LEAKS 50 : currentTimeStep(-1), myEvents() {}
69 execTimeStep = currTimeStep;
71 Event newEvent =
Event(operation, execTimeStep);
82 if (currEvent.second == execTime || currEvent.second < execTime +
DELTA_T) {
83 Command* command = currEvent.first;
87 time = command->
execute(execTime);
97 WRITE_WARNING(
"Command returned negative repeat number; will be deleted.");
99 delete currEvent.first;
101 currEvent.second += time;
105 if (currEvent.second < execTime) {
108 delete currEvent.first;
MSEventControl()
Default constructor.
virtual void execute(SUMOTime time)
Executes time-dependant commands.
static MSNet * getInstance()
Returns the pointer to the unique instance of MSNet (singleton).
Base (microsim) event class.
SUMOTime getCurrentTimeStep() const
Returns the current simulation step.
#define WRITE_WARNING(msg)
SUMOTime currentTimeStep
The Current TimeStep.
virtual SUMOTime execute(SUMOTime currentTime)=0
Executes the command.
void setCurrentTimeStep(SUMOTime time)
Set the current Time.
std::pair< Command *, SUMOTime > Event
Combination of an event and the time it shall be executed at.
AdaptType
Defines what to do if the insertion time lies before the current simulation time. ...
EventCont myEvents
Event-container, holds executable events.
SUMOTime getCurrentTimeStep()
get the Current TimeStep used in addEvent.
virtual SUMOTime addEvent(Command *operation, SUMOTime execTimeStep, AdaptType type)
Adds an Event.
virtual ~MSEventControl()
Destructor.
bool isEmpty()
Returns whether events are in the que.
Patch the time in a way that it is at least as high as the simulation begin time. ...