#include <Command_SaveTLSState.h>

Definition at line 52 of file Command_SaveTLSState.h.
Public Member Functions | |
| Command_SaveTLSState (const MSTLLogicControl::TLSLogicVariants &logics, OutputDevice &od) throw () | |
| Constructor. | |
| ~Command_SaveTLSState () throw () | |
| Destructor. | |
Derived from Command | |
| SUMOTime | execute (SUMOTime currentTime) throw (ProcessError) |
| Writes the current state of the tls. | |
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. | |
| Command_SaveTLSState::Command_SaveTLSState | ( | const MSTLLogicControl::TLSLogicVariants & | logics, | |
| OutputDevice & | od | |||
| ) | throw () |
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_SaveTLSState.cpp.
References MSEventControl::ADAPT_AFTER_EXECUTION, MSEventControl::addEvent(), MSNet::getEndOfTimestepEvents(), and MSNet::getInstance().
00046 : myOutputDevice(od), myLogics(logics) { 00047 MSNet::getInstance()->getEndOfTimestepEvents().addEvent(this, 00048 0, MSEventControl::ADAPT_AFTER_EXECUTION); 00049 myOutputDevice.writeXMLHeader("tls-states"); 00050 }
| Command_SaveTLSState::~Command_SaveTLSState | ( | ) | throw () |
| Command_SaveTLSState::Command_SaveTLSState | ( | const Command_SaveTLSState & | ) | [private] |
Invalidated copy constructor.
| SUMOTime Command_SaveTLSState::execute | ( | SUMOTime | currentTime | ) | throw (ProcessError) [virtual] |
Writes the current state of the tls.
Returns always 1.
| [in] | currentTime | The current simulation time (unused) |
| ProcessError | not here |
Implements Command.
Definition at line 58 of file Command_SaveTLSState.cpp.
References DELTA_T, MSTLLogicControl::TLSLogicVariants::getActive(), MSTrafficLightLogic::getCurrentPhaseDef(), MSTrafficLightLogic::getCurrentPhaseIndex(), MSTrafficLightLogic::getID(), MSPhaseDefinition::getState(), MSTrafficLightLogic::getSubID(), myLogics, myOutputDevice, and time2string().
00058 { 00059 myOutputDevice << " <tlsstate time=\"" << time2string(currentTime) 00060 << "\" id=\"" << myLogics.getActive()->getID() 00061 << "\" subid=\"" << myLogics.getActive()->getSubID() 00062 << "\" phase=\"" << myLogics.getActive()->getCurrentPhaseIndex() 00063 << "\" state=\"" << myLogics.getActive()->getCurrentPhaseDef().getState() << "\"/>\n"; 00064 return DELTA_T; 00065 }
| Command_SaveTLSState& Command_SaveTLSState::operator= | ( | const Command_SaveTLSState & | ) | [private] |
Invalidated assignment operator.
const MSTLLogicControl::TLSLogicVariants& Command_SaveTLSState::myLogics [private] |
The traffic light logic to use.
Definition at line 88 of file Command_SaveTLSState.h.
Referenced by execute().
OutputDevice& Command_SaveTLSState::myOutputDevice [private] |
The device to write to.
Definition at line 85 of file Command_SaveTLSState.h.
Referenced by execute().
1.5.6