SUMO - Simulation of Urban MObility
MSTLLogicControl::TLSLogicVariants Class Reference

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
MSTrafficLightLogicgetActive () const
std::vector
< MSTrafficLightLogic * > 
getAllLogics () const
MSTrafficLightLogicgetLogic (const std::string &programID) const
MSTrafficLightLogicgetLogicInstantiatingOff (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

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

Private Attributes

MSTrafficLightLogicmyCurrentProgram
 The currently used program.
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 86 of file MSTLLogicControl.h.


Constructor & Destructor Documentation

Invalidated copy constructor.


Member Function Documentation

void MSTLLogicControl::TLSLogicVariants::addLink ( MSLink link,
MSLane lane,
unsigned int  pos 
)
bool MSTLLogicControl::TLSLogicVariants::addLogic ( const std::string &  programID,
MSTrafficLightLogic logic,
bool  netWasLoaded,
bool  isNewDefault = true 
)

Adds a logic (program)

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::adaptLinkInformationFrom(), MSTrafficLightLogic::getID(), MSNet::getInstance(), MSTrafficLightLogic::getLinks(), MSTrafficLightLogic::getPhase(), MSPhaseDefinition::getState(), and MSTrafficLightLogic::setTrafficLightSignals().

Referenced by MSTLLogicControl::add(), and TraCIServerAPI_TLS::processSet().

Verifies traffic lights loaded from the network.

Comparse the phase state sizes of each phase with the accoring tls' number of controlled links.

Returns:
Whether all tls programs are valid

Definition at line 77 of file MSTLLogicControl.cpp.

References WRITE_ERROR.

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

Definition at line 135 of file MSTLLogicControl.cpp.

Referenced by TraCIServerAPI_TLS::processSet().

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

Invalidated assignment operator.

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

Definition at line 192 of file MSTLLogicControl.cpp.

Referenced by TraCIServerAPI_TLS::processSet().


Field Documentation

The currently used program.

Definition at line 133 of file MSTLLogicControl.h.

Originally loaded link states.

Definition at line 139 of file MSTLLogicControl.h.

The list of actions/commands to execute on switch.

Definition at line 142 of file MSTLLogicControl.h.

A map of subkeys to programs.

Definition at line 136 of file MSTLLogicControl.h.


The documentation for this class was generated from the following files:
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Friends Defines