![]() |
SUMO - Simulation of Urban MObility
|
Writes information about the green durations of a tls. More...
#include <Command_SaveTLSSwitches.h>
Public Member Functions | |
Command_SaveTLSSwitches (const MSTLLogicControl::TLSLogicVariants &logics, OutputDevice &od) | |
Constructor. More... | |
~Command_SaveTLSSwitches () | |
Destructor. More... | |
Derived from Command | |
SUMOTime | execute (SUMOTime currentTime) |
Writes the output if a change occured. More... | |
Private Member Functions | |
Command_SaveTLSSwitches (const Command_SaveTLSSwitches &) | |
Invalidated copy constructor. More... | |
Command_SaveTLSSwitches & | operator= (const Command_SaveTLSSwitches &) |
Invalidated assignment operator. More... | |
Private Attributes | |
const MSTLLogicControl::TLSLogicVariants & | myLogics |
The traffic light logic to use. More... | |
OutputDevice & | myOutputDevice |
The device to write to. More... | |
std::map< int, SUMOTime > | myPreviousLinkStates |
Storage for prior states; map from signal group to last green time begin. More... | |
Writes information about the green durations of a tls.
Definition at line 55 of file Command_SaveTLSSwitches.h.
Command_SaveTLSSwitches::Command_SaveTLSSwitches | ( | const MSTLLogicControl::TLSLogicVariants & | logics, |
OutputDevice & | od | ||
) |
Constructor.
[in] | tlls | The logic to write state of |
[in] | od | The output device to write the state into |
Definition at line 44 of file Command_SaveTLSSwitches.cpp.
References MSEventControl::addEvent(), MSNet::getEndOfTimestepEvents(), MSNet::getInstance(), myOutputDevice, and OutputDevice::writeXMLHeader().
Command_SaveTLSSwitches::~Command_SaveTLSSwitches | ( | ) |
Destructor.
Definition at line 52 of file Command_SaveTLSSwitches.cpp.
|
private |
Invalidated copy constructor.
Writes the output if a change occured.
Called in each tme step, this class computes which link have red since the last tls switch and writes the information about their green duration into the given stream.
Information whether a link had green and since when is stored in "myPreviousLinkStates".
[in] | currentTime | The current simulation time |
Implements Command.
Definition at line 57 of file Command_SaveTLSSwitches.cpp.
References DELTA_T, MSTLLogicControl::TLSLogicVariants::getActive(), MSTrafficLightLogic::getCurrentPhaseDef(), Named::getID(), MSLink::getLane(), MSTrafficLightLogic::getLanesAt(), MSTrafficLightLogic::getLinks(), MSTrafficLightLogic::getProgramID(), MSPhaseDefinition::getState(), LINKSTATE_TL_GREEN_MAJOR, LINKSTATE_TL_GREEN_MINOR, myLogics, myOutputDevice, myPreviousLinkStates, and time2string().
|
private |
Invalidated assignment operator.
|
private |
The traffic light logic to use.
Definition at line 95 of file Command_SaveTLSSwitches.h.
Referenced by execute().
|
private |
The device to write to.
Definition at line 92 of file Command_SaveTLSSwitches.h.
Referenced by Command_SaveTLSSwitches(), and execute().
|
private |
Storage for prior states; map from signal group to last green time begin.
Definition at line 98 of file Command_SaveTLSSwitches.h.
Referenced by execute().