Eclipse SUMO - Simulation of Urban MObility
|
Writes the state of the tls to a file (in each second) More...
#include <Command_SaveTLSState.h>
Public Member Functions | |
Command_SaveTLSState (const MSTLLogicControl::TLSLogicVariants &logics, OutputDevice &od, bool saveDetectors, bool saveConditions) | |
Constructor. | |
virtual SUMOTime | shiftTime (SUMOTime, SUMOTime, SUMOTime) |
Reschedule or deschedule the command when quick-loading state. | |
~Command_SaveTLSState () | |
Destructor. | |
Derived from Command | |
SUMOTime | execute (SUMOTime currentTime) |
Writes the current state of the tls. | |
Data Fields | |
int | priority = 0 |
Private Member Functions | |
Command_SaveTLSState (const Command_SaveTLSState &) | |
Invalidated copy constructor. | |
Command_SaveTLSState & | operator= (const Command_SaveTLSState &) |
Invalidated assignment operator. | |
Private Attributes | |
const MSTLLogicControl::TLSLogicVariants & | myLogics |
The traffic light logic to use. | |
OutputDevice & | myOutputDevice |
The device to write to. | |
const bool | mySaveConditions |
const bool | mySaveDetectors |
additiona logging | |
Writes the state of the tls to a file (in each second)
Definition at line 44 of file Command_SaveTLSState.h.
Command_SaveTLSState::Command_SaveTLSState | ( | const MSTLLogicControl::TLSLogicVariants & | logics, |
OutputDevice & | od, | ||
bool | saveDetectors, | ||
bool | saveConditions | ||
) |
Constructor.
[in] | tlls | The logic to write state of |
[in] | od | The output device to write the state into |
Definition at line 35 of file Command_SaveTLSState.cpp.
References MSEventControl::addEvent(), MSNet::getEndOfTimestepEvents(), and MSNet::getInstance().
Command_SaveTLSState::~Command_SaveTLSState | ( | ) |
Destructor.
Definition at line 45 of file Command_SaveTLSState.cpp.
|
private |
Invalidated copy constructor.
Writes the current state of the tls.
Returns always 1.
[in] | currentTime | The current simulation time (unused) |
Implements Command.
Definition at line 50 of file Command_SaveTLSState.cpp.
References OutputDevice::closeTag(), DELTA_T, MSTLLogicControl::TLSLogicVariants::getActive(), MSTrafficLightLogic::getConditions(), MSTrafficLightLogic::getCurrentPhaseDef(), MSTrafficLightLogic::getCurrentPhaseIndex(), MSTrafficLightLogic::getDetectorStates(), Named::getID(), MSPhaseDefinition::getName(), MSTrafficLightLogic::getProgramID(), MSPhaseDefinition::getState(), joinToString(), myLogics, myOutputDevice, mySaveConditions, mySaveDetectors, OutputDevice::openTag(), SUMO_ATTR_CONDITIONS, SUMO_ATTR_DETECTORS, SUMO_ATTR_ID, SUMO_ATTR_NAME, SUMO_ATTR_PHASE, SUMO_ATTR_PROGRAMID, SUMO_ATTR_STATE, SUMO_ATTR_TIME, time2string(), OutputDevice::writeAttr(), OutputDevice::writeXMLHeader(), and OutputDevice::wroteHeader().
|
private |
Invalidated assignment operator.
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.
|
private |
The traffic light logic to use.
Definition at line 79 of file Command_SaveTLSState.h.
Referenced by execute().
|
private |
The device to write to.
Definition at line 76 of file Command_SaveTLSState.h.
Referenced by execute().
|
private |
Definition at line 83 of file Command_SaveTLSState.h.
Referenced by execute().
|
private |
|
inherited |
Definition at line 87 of file Command.h.
Referenced by MSTransportableDevice_FCDReplay::MovePedestrians::MovePedestrians(), and MSTrafficLightLogic::SwitchCommand::SwitchCommand().