![]() |
Eclipse 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, int pos) |
bool | addLogic (const std::string &programID, MSTrafficLightLogic *logic, bool netWasLoaded, bool isNewDefault=true) |
Adds a logic (program) More... | |
void | addSwitchCommand (OnSwitchAction *c) |
bool | checkOriginalTLS () const |
Verifies traffic lights loaded from the network. More... | |
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) |
void | ignoreLinkIndex (int pos) |
bool | isActive (const MSTrafficLightLogic *tl) const |
void | saveInitialStates () |
void | setStateInstantiatingOnline (MSTLLogicControl &tlc, const std::string &state) |
void | switchTo (MSTLLogicControl &tlc, const std::string &programID) |
TLSLogicVariants () | |
Constructor. More... | |
~TLSLogicVariants () | |
Destructor. More... | |
Private Member Functions | |
TLSLogicVariants & | operator= (const TLSLogicVariants &) |
Invalidated assignment operator. More... | |
TLSLogicVariants (const TLSLogicVariants &) | |
Invalidated copy constructor. More... | |
Private Attributes | |
MSTrafficLightLogic * | myCurrentProgram |
The currently used program. More... | |
std::map< MSLink *, LinkState > | myOriginalLinkStates |
Originally loaded link states. More... | |
std::vector< OnSwitchAction * > | mySwitchActions |
The list of actions/commands to execute on switch. More... | |
std::map< std::string, MSTrafficLightLogic * > | myVariants |
A map of subkeys to programs. More... | |
Storage for all programs of a single tls.
This class joins all programs of a single tls.
Definition at line 85 of file MSTLLogicControl.h.
MSTLLogicControl::TLSLogicVariants::TLSLogicVariants | ( | ) |
Constructor.
Definition at line 48 of file MSTLLogicControl.cpp.
MSTLLogicControl::TLSLogicVariants::~TLSLogicVariants | ( | ) |
Destructor.
Definition at line 53 of file MSTLLogicControl.cpp.
|
private |
Invalidated copy constructor.
Definition at line 225 of file MSTLLogicControl.cpp.
Referenced by NLHandler::addConnection().
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 92 of file MSTLLogicControl.cpp.
References MSTrafficLightLogic::activateProgram(), MSTrafficLightLogic::adaptLinkInformationFrom(), Named::getID(), MSNet::getInstance(), MSTrafficLightLogic::getLinks(), MSTrafficLightLogic::getPhase(), MSPhaseDefinition::getState(), and MSTrafficLightLogic::setTrafficLightSignals().
Referenced by MSTLLogicControl::add(), and libsumo::TrafficLight::setCompleteRedYellowGreenDefinition().
void MSTLLogicControl::TLSLogicVariants::addSwitchCommand | ( | OnSwitchAction * | c | ) |
Definition at line 177 of file MSTLLogicControl.cpp.
Referenced by Command_SaveTLCoupledDet::Command_SaveTLCoupledDet().
bool MSTLLogicControl::TLSLogicVariants::checkOriginalTLS | ( | ) | const |
Verifies traffic lights loaded from the network.
Compare the phase state sizes of each phase with the according tls' number of controlled links.
Definition at line 65 of file MSTLLogicControl.cpp.
References WRITE_ERROR.
void MSTLLogicControl::TLSLogicVariants::executeOnSwitchActions | ( | ) | const |
Definition at line 217 of file MSTLLogicControl.cpp.
Referenced by MSSimpleTrafficLightLogic::changeStepAndDuration(), and MSTrafficLightLogic::SwitchCommand::execute().
MSTrafficLightLogic * MSTLLogicControl::TLSLogicVariants::getActive | ( | ) | const |
Definition at line 200 of file MSTLLogicControl.cpp.
Referenced by NLHandler::addConnection(), NLHandler::addE2Detector(), Command_SaveTLSProgram::execute(), Command_SaveTLSState::execute(), Command_SaveTLSSwitches::execute(), Command_SaveTLSSwitchStates::execute(), libsumo::TrafficLight::getControlledJunctions(), libsumo::TrafficLight::getControlledLanes(), libsumo::TrafficLight::getControlledLinks(), libsumo::TrafficLight::getParameter(), libsumo::TrafficLight::getPhase(), libsumo::TrafficLight::getPhaseName(), libsumo::TrafficLight::getProgram(), libsumo::TrafficLight::getRedYellowGreenState(), libsumo::TrafficLight::getServedPersonCount(), MSTLLogicControl::initWautSwitch(), TraCIServerAPI_TrafficLight::processGet(), libsumo::TrafficLight::setParameter(), libsumo::TrafficLight::setPhase(), libsumo::TrafficLight::setPhaseDuration(), libsumo::TrafficLight::setPhaseName(), and MSFullExport::writeTLS().
std::vector< MSTrafficLightLogic * > MSTLLogicControl::TLSLogicVariants::getAllLogics | ( | ) | const |
Definition at line 183 of file MSTLLogicControl.cpp.
Referenced by libsumo::TrafficLight::getCompleteRedYellowGreenDefinition(), GUITrafficLightLogicWrapper::getPopUpMenu(), GUIViewTraffic::onGamingClick(), and GUITrafficLightLogicWrapper::switchTLSLogic().
MSTrafficLightLogic * MSTLLogicControl::TLSLogicVariants::getLogic | ( | const std::string & | programID | ) | const |
Definition at line 127 of file MSTLLogicControl.cpp.
Referenced by libsumo::TrafficLight::setCompleteRedYellowGreenDefinition().
MSTrafficLightLogic * MSTLLogicControl::TLSLogicVariants::getLogicInstantiatingOff | ( | MSTLLogicControl & | tlc, |
const std::string & | programID | ||
) |
Definition at line 136 of file MSTLLogicControl.cpp.
Referenced by MSTLLogicControl::initWautSwitch().
void MSTLLogicControl::TLSLogicVariants::ignoreLinkIndex | ( | int | pos | ) |
Definition at line 232 of file MSTLLogicControl.cpp.
Referenced by NLHandler::addConnection().
bool MSTLLogicControl::TLSLogicVariants::isActive | ( | const MSTrafficLightLogic * | tl | ) | const |
Definition at line 194 of file MSTLLogicControl.cpp.
Referenced by GUITrafficLightLogicWrapper::getPopUpMenu().
|
private |
Invalidated assignment operator.
void MSTLLogicControl::TLSLogicVariants::saveInitialStates | ( | ) |
Definition at line 86 of file MSTLLogicControl.cpp.
void MSTLLogicControl::TLSLogicVariants::setStateInstantiatingOnline | ( | MSTLLogicControl & | tlc, |
const std::string & | state | ||
) |
Definition at line 155 of file MSTLLogicControl.cpp.
References MSNet::createTLWrapper(), DELTA_T, MSNet::getCurrentTimeStep(), MSNet::getInstance(), MSTLLogicControl::switchTo(), and TLTYPE_STATIC.
Referenced by libsumo::TrafficLight::setRedYellowGreenState().
void MSTLLogicControl::TLSLogicVariants::switchTo | ( | MSTLLogicControl & | tlc, |
const std::string & | programID | ||
) |
Definition at line 206 of file MSTLLogicControl.cpp.
References MSNet::getInstance().
Referenced by libsumo::TrafficLight::setProgram().
|
private |
The currently used program.
Definition at line 142 of file MSTLLogicControl.h.
Originally loaded link states.
Definition at line 148 of file MSTLLogicControl.h.
|
private |
The list of actions/commands to execute on switch.
Definition at line 151 of file MSTLLogicControl.h.
|
private |
A map of subkeys to programs.
Definition at line 145 of file MSTLLogicControl.h.