Eclipse SUMO - Simulation of Urban MObility
Loading...
Searching...
No Matches
MSTLLogicControl::TLSLogicVariants Class Reference

Storage for all programs of a single tls. More...

#include <MSTLLogicControl.h>

Collaboration diagram for MSTLLogicControl::TLSLogicVariants:
[legend]

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). In case of an error the logic gets deleted.
 
void addSwitchCommand (OnSwitchAction *c)
 
bool checkOriginalTLS () const
 Verifies traffic lights loaded from the network.
 
void executeOnSwitchActions () const
 
MSTrafficLightLogicgetActive () const
 
std::vector< MSTrafficLightLogic * > getAllLogics () const
 
MSTrafficLightLogicgetDefault () const
 return the default program (that last used program except TRACI_PROGRAM)
 
MSTrafficLightLogicgetLogic (const std::string &programID) const
 
MSTrafficLightLogicgetLogicInstantiatingOff (MSTLLogicControl &tlc, const std::string &programID)
 
void ignoreLinkIndex (int pos)
 
bool isActive (const MSTrafficLightLogic *tl) const
 
void saveInitialStates ()
 
void saveState (OutputDevice &out)
 
void setStateInstantiatingOnline (MSTLLogicControl &tlc, const std::string &state)
 
void switchTo (MSTLLogicControl &tlc, const std::string &programID)
 
 TLSLogicVariants ()
 Constructor.
 
 ~TLSLogicVariants ()
 Destructor.
 

Private Member Functions

TLSLogicVariantsoperator= (const TLSLogicVariants &)
 Invalidated assignment operator.
 
 TLSLogicVariants (const TLSLogicVariants &)
 Invalidated copy constructor.
 

Private Attributes

MSTrafficLightLogicmyCurrentProgram
 The currently used program.
 
MSTrafficLightLogicmyDefaultProgram
 The program that would be used in the absence of TraCI.
 
std::map< MSLink *, LinkStatemyOriginalLinkStates
 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.
 

Detailed Description

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.

Constructor & Destructor Documentation

◆ TLSLogicVariants() [1/2]

MSTLLogicControl::TLSLogicVariants::TLSLogicVariants ( )

Constructor.

Definition at line 51 of file MSTLLogicControl.cpp.

◆ ~TLSLogicVariants()

MSTLLogicControl::TLSLogicVariants::~TLSLogicVariants ( )

Destructor.

Definition at line 57 of file MSTLLogicControl.cpp.

◆ TLSLogicVariants() [2/2]

MSTLLogicControl::TLSLogicVariants::TLSLogicVariants ( const TLSLogicVariants )
private

Invalidated copy constructor.

Member Function Documentation

◆ addLink()

void MSTLLogicControl::TLSLogicVariants::addLink ( MSLink link,
MSLane lane,
int  pos 
)

Definition at line 251 of file MSTLLogicControl.cpp.

Referenced by NLHandler::addConnection().

Here is the caller graph for this function:

◆ addLogic()

bool MSTLLogicControl::TLSLogicVariants::addLogic ( const std::string &  programID,
MSTrafficLightLogic logic,
bool  netWasLoaded,
bool  isNewDefault = true 
)

Adds a logic (program). In case of an error the logic gets deleted.

Parameters
[in]programIDThe sub-id of this program
[in]logicThe logic to add
[in]netWasLoadedWhether the network has already been loaded (the links have been assigned)
[in]isNewDefaultWhether this logic shall be treated as the currently active logic

Definition at line 104 of file MSTLLogicControl.cpp.

References MSTrafficLightLogic::activateProgram(), MSTrafficLightLogic::adaptLinkInformationFrom(), Named::getID(), MSNet::getInstance(), MSTrafficLightLogic::getLinks(), MSTrafficLightLogic::getPhase(), MSPhaseDefinition::getState(), MSTrafficLightLogic::setTrafficLightSignals(), and TLF.

Referenced by MSTLLogicControl::add(), and LIBSUMO_NAMESPACE::TrafficLight::setProgramLogic().

Here is the caller graph for this function:

◆ addSwitchCommand()

void MSTLLogicControl::TLSLogicVariants::addSwitchCommand ( OnSwitchAction c)

Definition at line 198 of file MSTLLogicControl.cpp.

Referenced by Command_SaveTLCoupledDet::Command_SaveTLCoupledDet().

Here is the caller graph for this function:

◆ checkOriginalTLS()

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.

Returns
Whether all tls programs are valid

Definition at line 69 of file MSTLLogicControl.cpp.

References TL, and WRITE_ERRORF.

◆ executeOnSwitchActions()

void MSTLLogicControl::TLSLogicVariants::executeOnSwitchActions ( ) const

Definition at line 243 of file MSTLLogicControl.cpp.

Referenced by MSActuatedTrafficLightLogic::changeStepAndDuration(), MSSimpleTrafficLightLogic::changeStepAndDuration(), MSTrafficLightLogic::SwitchCommand::execute(), MSActuatedTrafficLightLogic::loadState(), and LIBSUMO_NAMESPACE::TrafficLight::setProgramLogic().

Here is the caller graph for this function:

◆ getActive()

◆ getAllLogics()

std::vector< MSTrafficLightLogic * > MSTLLogicControl::TLSLogicVariants::getAllLogics ( ) const

Definition at line 204 of file MSTLLogicControl.cpp.

Referenced by LIBSUMO_NAMESPACE::TrafficLight::getAllProgramLogics(), GUITrafficLightLogicWrapper::getPopUpMenu(), and GUITrafficLightLogicWrapper::switchTLSLogic().

Here is the caller graph for this function:

◆ getDefault()

MSTrafficLightLogic * MSTLLogicControl::TLSLogicVariants::getDefault ( ) const

◆ getLogic()

MSTrafficLightLogic * MSTLLogicControl::TLSLogicVariants::getLogic ( const std::string &  programID) const

Definition at line 147 of file MSTLLogicControl.cpp.

Referenced by MSTLLogicControl::get(), and LIBSUMO_NAMESPACE::TrafficLight::setProgramLogic().

Here is the caller graph for this function:

◆ getLogicInstantiatingOff()

MSTrafficLightLogic * MSTLLogicControl::TLSLogicVariants::getLogicInstantiatingOff ( MSTLLogicControl tlc,
const std::string &  programID 
)

Definition at line 156 of file MSTLLogicControl.cpp.

References TLF.

Referenced by MSTLLogicControl::initWautSwitch().

Here is the caller graph for this function:

◆ ignoreLinkIndex()

void MSTLLogicControl::TLSLogicVariants::ignoreLinkIndex ( int  pos)

Definition at line 258 of file MSTLLogicControl.cpp.

Referenced by NLHandler::addConnection().

Here is the caller graph for this function:

◆ isActive()

bool MSTLLogicControl::TLSLogicVariants::isActive ( const MSTrafficLightLogic tl) const

Definition at line 215 of file MSTLLogicControl.cpp.

Referenced by GUITrafficLightLogicWrapper::getPopUpMenu().

Here is the caller graph for this function:

◆ operator=()

TLSLogicVariants & MSTLLogicControl::TLSLogicVariants::operator= ( const TLSLogicVariants )
private

Invalidated assignment operator.

◆ saveInitialStates()

void MSTLLogicControl::TLSLogicVariants::saveInitialStates ( )

Definition at line 90 of file MSTLLogicControl.cpp.

◆ saveState()

void MSTLLogicControl::TLSLogicVariants::saveState ( OutputDevice out)

Definition at line 96 of file MSTLLogicControl.cpp.

◆ setStateInstantiatingOnline()

void MSTLLogicControl::TLSLogicVariants::setStateInstantiatingOnline ( MSTLLogicControl tlc,
const std::string &  state 
)

Definition at line 175 of file MSTLLogicControl.cpp.

References MSNet::createTLWrapper(), DELTA_T, MSNet::getCurrentTimeStep(), MSNet::getInstance(), STATIC, MSTLLogicControl::switchTo(), and TRACI_PROGRAM.

Referenced by LIBSUMO_NAMESPACE::TrafficLight::setRedYellowGreenState().

Here is the caller graph for this function:

◆ switchTo()

void MSTLLogicControl::TLSLogicVariants::switchTo ( MSTLLogicControl tlc,
const std::string &  programID 
)

Definition at line 232 of file MSTLLogicControl.cpp.

References MSTrafficLightLogic::deactivateProgram(), and MSNet::getInstance().

Referenced by LIBSUMO_NAMESPACE::TrafficLight::setProgram().

Here is the caller graph for this function:

Field Documentation

◆ myCurrentProgram

MSTrafficLightLogic* MSTLLogicControl::TLSLogicVariants::myCurrentProgram
private

The currently used program.

Definition at line 141 of file MSTLLogicControl.h.

◆ myDefaultProgram

MSTrafficLightLogic* MSTLLogicControl::TLSLogicVariants::myDefaultProgram
private

The program that would be used in the absence of TraCI.

Definition at line 144 of file MSTLLogicControl.h.

◆ myOriginalLinkStates

std::map<MSLink*, LinkState> MSTLLogicControl::TLSLogicVariants::myOriginalLinkStates
private

Originally loaded link states.

Definition at line 150 of file MSTLLogicControl.h.

◆ mySwitchActions

std::vector<OnSwitchAction*> MSTLLogicControl::TLSLogicVariants::mySwitchActions
private

The list of actions/commands to execute on switch.

Definition at line 153 of file MSTLLogicControl.h.

◆ myVariants

std::map<std::string, MSTrafficLightLogic*> MSTLLogicControl::TLSLogicVariants::myVariants
private

A map of subkeys to programs.

Definition at line 147 of file MSTLLogicControl.h.


The documentation for this class was generated from the following files: