Eclipse SUMO - Simulation of Urban MObility
|
Base (microsim) event class. More...
#include <Command.h>
Public Member Functions | |
Command () | |
Constructor. | |
virtual SUMOTime | execute (SUMOTime currentTime)=0 |
Executes the command. | |
virtual SUMOTime | shiftTime (SUMOTime, SUMOTime, SUMOTime) |
Reschedule or deschedule the command when quick-loading state. | |
virtual | ~Command () |
Destructor. | |
Data Fields | |
int | priority = 0 |
Base (microsim) event class.
Classes derived from Command may be added to MSEventControl instances in order to be executed at a certain time step.
As soon as the simulation reaches the desired time step, the command (event) is executed by calling "execute" with the current time step. The method must return either 0, if the event shall not be executed again or a positive value (in simulation seconds) that described when it shall be executed again. The method must not return a value below zero, the behaviour is undefined in this case.
Executes the command.
The implementations should return 0 if the command shall not be repeated, or a value larger than 0 that describe the time after which the command shall be executed again. Values below 0 must not be returned.
[in] | currentTime | The current simulation time |
ProcessError | Derived actions may throw this exception |
Implemented in Command_Hotkey_InductionLoop, Command_Hotkey_TrafficLight, METriggeredCalibrator, Command_SaveTLSProgram, Command_SaveTLSState, Command_SaveTLSSwitches, Command_SaveTLSSwitchStates, Command_RouteReplacement, MSDevice_BTreceiver::BTreceiverUpdate, MSTransportableDevice_FCDReplay::MovePedestrians, MSVehicleControl::DeleteKeptVehicle, MSVTypeProbe, MSTrafficLightLogic::SwitchCommand, MSPerson::MSPersonStage_Access::ProceedCmd, MSPModel_NonInteracting::MoveToNextEdge, MSPModel_Striping::MovePedestrians, MSStageDriving::BookReservation, MSCalibrator, MSCalibrator::CalibratorCommand, ParametrisedWrappingCommand< T, S >, StaticCommand< T >, WrappingCommand< T >, WrappingCommand< MSDevice_Routing >, WrappingCommand< MSDevice_StationFinder >, WrappingCommand< MSDevice_ToC >, WrappingCommand< MSTransportable >, WrappingCommand< MSTransportableDevice_Routing >, MSDevice_FCDReplay::MoveVehicles, MSPModel_JuPedSim::Event, and MSTLLogicControl::SwitchInitCommand.
Referenced by MSEventControl::execute().
Reschedule or deschedule the command when quick-loading state.
The implementations should return -1 if the command shall not be re-scheduled, or a value >= 0 that describe the new time at which the command shall be executed again.
[in] | currentTime | The current simulation time |
[in] | execTime | The time at which the command would have been executed |
[in] | newTime | The simulation time at which the simulation is restarted |
Reimplemented in MSTrafficLightLogic::SwitchCommand, and MSCalibrator::CalibratorCommand.
int Command::priority = 0 |
Definition at line 87 of file Command.h.
Referenced by MSTransportableDevice_FCDReplay::MovePedestrians::MovePedestrians(), and MSTrafficLightLogic::SwitchCommand::SwitchCommand().