SUMO - Simulation of Urban MObility
|
Base (microsim) event class. More...
#include <Command.h>
Public Member Functions | |
Command () | |
Constructor. More... | |
virtual SUMOTime | execute (SUMOTime currentTime)=0 |
Executes the command. More... | |
virtual | ~Command () |
Destructor. More... | |
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 MSTLLogicControl::SwitchInitCommand, MSTrafficLightLogic::SwitchCommand, MSDevice_BTreceiver::BTreceiverUpdate, MSPModel_Striping::MovePedestrians, WrappingCommand< T >, WrappingCommand< MSDevice_Routing >, StaticCommand< T >, MSVTypeProbe, Command_SaveTLSSwitches, MSLaneSpeedTrigger, Command_SaveTLSSwitchStates, Command_SaveTLSState, MSPModel_NonInteracting::MoveToNextEdge, and MSCalibrator.
Referenced by MSEventControl::execute().