|
SUMO - Simulation of Urban MObility
|
Storage for all programs of a single tls. More...
#include <MSTLLogicControl.h>
Public Member Functions | |
| void | addLink (MSLink *link, MSLane *lane, unsigned int pos) |
| bool | addLogic (const std::string &programID, MSTrafficLightLogic *logic, bool netWasLoaded, bool isNewDefault=true) |
| Adds a logic (program) | |
| void | addSwitchCommand (OnSwitchAction *c) |
| bool | checkOriginalTLS () const |
| Verifies traffic lights loaded from the network. | |
| void | executeOnSwitchActions () const |
| MSTrafficLightLogic * | getActive () const |
| std::vector < MSTrafficLightLogic * > | getAllLogics () const |
| MSTrafficLightLogic * | getLogic (const std::string &programID) const |
| MSTrafficLightLogic * | getLogicInstantiatingOff (MSTLLogicControl &tlc, const std::string &programID) |
| bool | isActive (const MSTrafficLightLogic *tl) const |
| void | saveInitialStates () |
| void | switchTo (MSTLLogicControl &tlc, const std::string &programID) |
| TLSLogicVariants () | |
| Constructor. | |
| ~TLSLogicVariants () | |
| Destructor. | |
Private Member Functions | |
| TLSLogicVariants & | operator= (const TLSLogicVariants &) |
| Invalidated assignment operator. | |
| TLSLogicVariants (const TLSLogicVariants &) | |
| Invalidated copy constructor. | |
Private Attributes | |
| MSTrafficLightLogic * | myCurrentProgram |
| The currently used program. | |
| std::map< MSLink *, LinkState > | myOriginalLinkStates |
| Originally loaded link states. | |
| std::vector< OnSwitchAction * > | mySwitchActions |
| The list of actions/commands to execute on switch. | |
| std::map< std::string, MSTrafficLightLogic * > | myVariants |
| A map of subkeys to programs. | |
Storage for all programs of a single tls.
This class joins all programs of a single tls.
Definition at line 81 of file MSTLLogicControl.h.
| MSTLLogicControl::TLSLogicVariants::TLSLogicVariants | ( | ) |
Constructor.
Definition at line 53 of file MSTLLogicControl.cpp.
| MSTLLogicControl::TLSLogicVariants::~TLSLogicVariants | ( | ) |
Destructor.
Definition at line 58 of file MSTLLogicControl.cpp.
| MSTLLogicControl::TLSLogicVariants::TLSLogicVariants | ( | const TLSLogicVariants & | ) | [private] |
Invalidated copy constructor.
Definition at line 200 of file MSTLLogicControl.cpp.
Referenced by NLHandler::addConnection(), and NLSucceedingLaneBuilder::addSuccLane().
| bool MSTLLogicControl::TLSLogicVariants::addLogic | ( | const std::string & | programID, |
| MSTrafficLightLogic * | logic, | ||
| bool | netWasLoaded, | ||
| bool | isNewDefault = true |
||
| ) |
Adds a logic (program)
| [in] | programID | The sub-id of this program |
| [in] | logic | The logic to add |
| [in] | netWasLoaded | Whether the network has already been loaded (the links have been assigned) |
| [in] | isNewDefault | Whether this logic shall be treated as the currently active logic |
Definition at line 97 of file MSTLLogicControl.cpp.
References MSTrafficLightLogic::adaptLinkInformationFrom(), MSTrafficLightLogic::getID(), MSNet::getInstance(), MSTrafficLightLogic::getLinks(), MSTrafficLightLogic::getPhase(), MSPhaseDefinition::getState(), and MSTrafficLightLogic::setTrafficLightSignals().
Referenced by MSTLLogicControl::add(), and TraCIServerAPI_TLS::processSet().
| void MSTLLogicControl::TLSLogicVariants::addSwitchCommand | ( | OnSwitchAction * | c | ) |
Definition at line 156 of file MSTLLogicControl.cpp.
Referenced by Command_SaveTLCoupledDet::Command_SaveTLCoupledDet().
| bool MSTLLogicControl::TLSLogicVariants::checkOriginalTLS | ( | ) | const |
Verifies traffic lights loaded from the network.
Comparse the phase state sizes of each phase with the accoring tls' number of controlled links.
Definition at line 70 of file MSTLLogicControl.cpp.
References WRITE_ERROR.
| void MSTLLogicControl::TLSLogicVariants::executeOnSwitchActions | ( | ) | const |
Definition at line 192 of file MSTLLogicControl.cpp.
Referenced by MSTrafficLightLogic::SwitchCommand::execute(), and TraCIServerAPI_TLS::processSet().
| MSTrafficLightLogic * MSTLLogicControl::TLSLogicVariants::getActive | ( | ) | const |
Definition at line 179 of file MSTLLogicControl.cpp.
Referenced by NLHandler::addConnection(), Command_SaveTLSSwitchStates::execute(), Command_SaveTLSSwitches::execute(), Command_SaveTLSState::execute(), MSTLLogicControl::initWautSwitch(), TraCIServerAPI_TLS::processGet(), and TraCIServerAPI_TLS::processSet().
| std::vector< MSTrafficLightLogic * > MSTLLogicControl::TLSLogicVariants::getAllLogics | ( | ) | const |
Definition at line 162 of file MSTLLogicControl.cpp.
Referenced by GUITrafficLightLogicWrapper::getPopUpMenu(), GUIViewTraffic::onGamingClick(), TraCIServerAPI_TLS::processGet(), and GUITrafficLightLogicWrapper::switchTLSLogic().
| MSTrafficLightLogic * MSTLLogicControl::TLSLogicVariants::getLogic | ( | const std::string & | programID | ) | const |
Definition at line 128 of file MSTLLogicControl.cpp.
Referenced by TraCIServerAPI_TLS::processSet().
| MSTrafficLightLogic * MSTLLogicControl::TLSLogicVariants::getLogicInstantiatingOff | ( | MSTLLogicControl & | tlc, |
| const std::string & | programID | ||
| ) |
Definition at line 137 of file MSTLLogicControl.cpp.
Referenced by MSTLLogicControl::initWautSwitch().
| bool MSTLLogicControl::TLSLogicVariants::isActive | ( | const MSTrafficLightLogic * | tl | ) | const |
Definition at line 173 of file MSTLLogicControl.cpp.
Referenced by GUITrafficLightLogicWrapper::getPopUpMenu().
| TLSLogicVariants& MSTLLogicControl::TLSLogicVariants::operator= | ( | const TLSLogicVariants & | ) | [private] |
Invalidated assignment operator.
| void MSTLLogicControl::TLSLogicVariants::saveInitialStates | ( | ) |
Definition at line 91 of file MSTLLogicControl.cpp.
| void MSTLLogicControl::TLSLogicVariants::switchTo | ( | MSTLLogicControl & | tlc, |
| const std::string & | programID | ||
| ) |
Definition at line 185 of file MSTLLogicControl.cpp.
Referenced by TraCIServerAPI_TLS::processSet().
The currently used program.
Definition at line 128 of file MSTLLogicControl.h.
std::map<MSLink*, LinkState> MSTLLogicControl::TLSLogicVariants::myOriginalLinkStates [private] |
Originally loaded link states.
Definition at line 134 of file MSTLLogicControl.h.
std::vector<OnSwitchAction*> MSTLLogicControl::TLSLogicVariants::mySwitchActions [private] |
The list of actions/commands to execute on switch.
Definition at line 137 of file MSTLLogicControl.h.
std::map<std::string, MSTrafficLightLogic*> MSTLLogicControl::TLSLogicVariants::myVariants [private] |
A map of subkeys to programs.
Definition at line 131 of file MSTLLogicControl.h.