60 if (currEvent.second < 0) {
61 currEvent.second = execTime;
63 if (currEvent.second < execTime +
DELTA_T) {
64 Command* command = currEvent.first;
69 time = command->
execute(execTime);
79 WRITE_WARNING(
"Command returned negative repeat number; will be deleted.");
81 delete currEvent.first;
83 addEvent(currEvent.first, currEvent.second + time);
99 return e1.second == e2.second ? e1.first->priority < e2.first->priority : e1.second > e2.second;
105 eventIt->second = eventIt->first->shiftTime(currentTime, eventIt->second, newTime);
106 if (eventIt->second >= 0) {
109 delete eventIt->first;
#define WRITE_WARNING(msg)
Base (microsim) event class.
virtual SUMOTime execute(SUMOTime currentTime)=0
Executes the command.
virtual void execute(SUMOTime time)
Executes time-dependant commands.
static bool eventCompare(const Event &e1, const Event &e2)
compares two events
bool isEmpty()
Returns whether events are in the que.
std::pair< Command *, SUMOTime > Event
Combination of an event and the time it shall be executed at.
MSEventControl()
Default constructor.
void clearState(SUMOTime currentTime, SUMOTime newTime)
Remove all events before quick-loading state.
virtual void addEvent(Command *operation, SUMOTime execTimeStep=-1)
Adds an Event.
virtual ~MSEventControl()
Destructor.
std::vector< Event > myEvents
Event-container, holds executable events.