Eclipse SUMO - Simulation of Urban MObility
libsumo::TrafficLight Class Reference

#include <TrafficLight.h>

Static Public Member Functions

static std::vector< TraCILogicgetAllProgramLogics (const std::string &tlsID)
 
static std::vector< std::string > getBlockingVehicles (const std::string &tlsID, int linkIndex)
 
static std::vector< TraCILogicgetCompleteRedYellowGreenDefinition (const std::string &tlsID)
 
static std::vector< std::string > getControlledJunctions (const std::string &tlsID)
 
static std::vector< std::string > getControlledLanes (const std::string &tlsID)
 
static std::vector< std::vector< TraCILink > > getControlledLinks (const std::string &tlsID)
 
static double getNextSwitch (const std::string &tlsID)
 
static int getPhase (const std::string &tlsID)
 
static double getPhaseDuration (const std::string &tlsID)
 
static std::string getPhaseName (const std::string &tlsID)
 
static std::vector< std::string > getPriorityVehicles (const std::string &tlsID, int linkIndex)
 
static std::string getProgram (const std::string &tlsID)
 
static std::string getRedYellowGreenState (const std::string &tlsID)
 
static std::vector< std::string > getRivalVehicles (const std::string &tlsID, int linkIndex)
 
static int getServedPersonCount (const std::string &tlsID, int index)
 
static bool handleVariable (const std::string &objID, const int variable, VariableWrapper *wrapper)
 
static std::shared_ptr< VariableWrappermakeWrapper ()
 
static void setCompleteRedYellowGreenDefinition (const std::string &tlsID, const TraCILogic &logic)
 
static void setPhase (const std::string &tlsID, const int index)
 
static void setPhaseDuration (const std::string &tlsID, const double phaseDuration)
 
static void setPhaseName (const std::string &tlsID, const std::string &name)
 
static void setProgram (const std::string &tlsID, const std::string &programID)
 
static void setProgramLogic (const std::string &tlsID, const TraCILogic &logic)
 
LIBSUMO_ID_PARAMETER_API static LIBSUMO_SUBSCRIPTION_API void setRedYellowGreenState (const std::string &tlsID, const std::string &state)
 

Private Member Functions

 TrafficLight ()=delete
 invalidated standard constructor More...
 

Static Private Member Functions

static MSTLLogicControl::TLSLogicVariantsgetTLS (const std::string &id)
 

Static Private Attributes

static ContextSubscriptionResults myContextSubscriptionResults
 
static SubscriptionResults mySubscriptionResults
 

Detailed Description

Definition at line 51 of file TrafficLight.h.

Constructor & Destructor Documentation

◆ TrafficLight()

libsumo::TrafficLight::TrafficLight ( )
privatedelete

invalidated standard constructor

Member Function Documentation

◆ getAllProgramLogics()

std::vector< TraCILogic > TrafficLight::getAllProgramLogics ( const std::string &  tlsID)
static

Definition at line 69 of file TrafficLight.cpp.

References MSTLLogicControl::TLSLogicVariants::getAllLogics(), getTLS(), STEPS2TIME, and libsumo::TraCILogic::subParameter.

Referenced by getCompleteRedYellowGreenDefinition().

Here is the caller graph for this function:

◆ getBlockingVehicles()

std::vector< std::string > TrafficLight::getBlockingVehicles ( const std::string &  tlsID,
int  linkIndex 
)
static

Definition at line 206 of file TrafficLight.cpp.

References MSTrafficLightLogic::getBlockingVehicles(), MSTLLogicControl::TLSLogicVariants::getDefault(), MSTrafficLightLogic::getNumLinks(), getTLS(), and toString().

Referenced by TraCIServerAPI_TrafficLight::processGet().

Here is the caller graph for this function:

◆ getCompleteRedYellowGreenDefinition()

static std::vector<TraCILogic> libsumo::TrafficLight::getCompleteRedYellowGreenDefinition ( const std::string &  tlsID)
inlinestatic

Definition at line 85 of file TrafficLight.h.

References getAllProgramLogics().

Referenced by TraCIServerAPI_TrafficLight::processGet().

Here is the caller graph for this function:

◆ getControlledJunctions()

std::vector< std::string > TrafficLight::getControlledJunctions ( const std::string &  tlsID)
static

Definition at line 87 of file TrafficLight.cpp.

References MSTLLogicControl::TLSLogicVariants::getActive(), MSTrafficLightLogic::getLinks(), and getTLS().

Referenced by handleVariable().

Here is the caller graph for this function:

◆ getControlledLanes()

std::vector< std::string > TrafficLight::getControlledLanes ( const std::string &  tlsID)
static

Definition at line 100 of file TrafficLight.cpp.

References MSTLLogicControl::TLSLogicVariants::getActive(), MSTrafficLightLogic::getLaneVectors(), and getTLS().

Referenced by handleVariable().

Here is the caller graph for this function:

◆ getControlledLinks()

std::vector< std::vector< TraCILink > > TrafficLight::getControlledLinks ( const std::string &  tlsID)
static

Definition at line 113 of file TrafficLight.cpp.

References MSTLLogicControl::TLSLogicVariants::getActive(), Named::getID(), MSLink::getLane(), MSTrafficLightLogic::getLaneVectors(), MSTrafficLightLogic::getLinks(), getTLS(), and MSLink::getViaLane().

Referenced by TraCIServerAPI_TrafficLight::processGet().

Here is the caller graph for this function:

◆ getNextSwitch()

double TrafficLight::getNextSwitch ( const std::string &  tlsID)
static

Definition at line 161 of file TrafficLight.cpp.

References getTLS(), and STEPS2TIME.

Referenced by handleVariable().

Here is the caller graph for this function:

◆ getPhase()

int TrafficLight::getPhase ( const std::string &  tlsID)
static

Definition at line 143 of file TrafficLight.cpp.

References MSTLLogicControl::TLSLogicVariants::getActive(), MSTrafficLightLogic::getCurrentPhaseIndex(), and getTLS().

Referenced by handleVariable().

Here is the caller graph for this function:

◆ getPhaseDuration()

double TrafficLight::getPhaseDuration ( const std::string &  tlsID)
static

Definition at line 155 of file TrafficLight.cpp.

References getTLS(), and STEPS2TIME.

Referenced by handleVariable().

Here is the caller graph for this function:

◆ getPhaseName()

std::string TrafficLight::getPhaseName ( const std::string &  tlsID)
static

Definition at line 149 of file TrafficLight.cpp.

References MSTLLogicControl::TLSLogicVariants::getActive(), MSTrafficLightLogic::getCurrentPhaseDef(), MSPhaseDefinition::getName(), and getTLS().

Referenced by handleVariable().

Here is the caller graph for this function:

◆ getPriorityVehicles()

std::vector< std::string > TrafficLight::getPriorityVehicles ( const std::string &  tlsID,
int  linkIndex 
)
static

Definition at line 235 of file TrafficLight.cpp.

References MSTLLogicControl::TLSLogicVariants::getActive(), MSTLLogicControl::TLSLogicVariants::getDefault(), MSTrafficLightLogic::getNumLinks(), Parameterised::getParameter(), MSTrafficLightLogic::getPriorityVehicles(), getTLS(), LIBSUMO_GET_PARAMETER_WITH_KEY_IMPLEMENTATION, and toString().

Referenced by TraCIServerAPI_TrafficLight::processGet().

Here is the caller graph for this function:

◆ getProgram()

std::string TrafficLight::getProgram ( const std::string &  tlsID)
static

Definition at line 137 of file TrafficLight.cpp.

References MSTLLogicControl::TLSLogicVariants::getActive(), MSTrafficLightLogic::getProgramID(), and getTLS().

Referenced by handleVariable().

Here is the caller graph for this function:

◆ getRedYellowGreenState()

std::string TrafficLight::getRedYellowGreenState ( const std::string &  tlsID)
static

Definition at line 63 of file TrafficLight.cpp.

References MSTLLogicControl::TLSLogicVariants::getActive(), MSTrafficLightLogic::getCurrentPhaseDef(), MSPhaseDefinition::getState(), and getTLS().

Referenced by handleVariable().

Here is the caller graph for this function:

◆ getRivalVehicles()

std::vector< std::string > TrafficLight::getRivalVehicles ( const std::string &  tlsID,
int  linkIndex 
)
static

Definition at line 221 of file TrafficLight.cpp.

References MSTLLogicControl::TLSLogicVariants::getDefault(), MSTrafficLightLogic::getNumLinks(), MSTrafficLightLogic::getRivalVehicles(), getTLS(), and toString().

Referenced by TraCIServerAPI_TrafficLight::processGet().

Here is the caller graph for this function:

◆ getServedPersonCount()

int TrafficLight::getServedPersonCount ( const std::string &  tlsID,
int  index 
)
static

Definition at line 166 of file TrafficLight.cpp.

References MSTLLogicControl::TLSLogicVariants::getActive(), MSTransportable::getEdge(), MSLane::getEdge(), MSTransportable::getLane(), MSLane::getLinkCont(), MSTrafficLightLogic::getLinksAt(), MSEdge::getPersons(), MSTrafficLightLogic::getPhaseNumber(), MSTrafficLightLogic::getPhases(), getTLS(), and toString().

Referenced by TraCIServerAPI_TrafficLight::processGet().

Here is the caller graph for this function:

◆ getTLS()

◆ handleVariable()

◆ makeWrapper()

std::shared_ptr< VariableWrapper > TrafficLight::makeWrapper ( )
static

◆ setCompleteRedYellowGreenDefinition()

static void libsumo::TrafficLight::setCompleteRedYellowGreenDefinition ( const std::string &  tlsID,
const TraCILogic logic 
)
inlinestatic

Definition at line 88 of file TrafficLight.h.

References getTLS(), and setProgramLogic().

Referenced by TraCIServerAPI_TrafficLight::processSet().

Here is the caller graph for this function:

◆ setPhase()

void TrafficLight::setPhase ( const std::string &  tlsID,
const int  index 
)
static

Definition at line 264 of file TrafficLight.cpp.

References MSTrafficLightLogic::changeStepAndDuration(), MSPhaseDefinition::duration, MSTLLogicControl::TLSLogicVariants::getActive(), MSNet::getCurrentTimeStep(), MSNet::getInstance(), MSTrafficLightLogic::getPhase(), MSTrafficLightLogic::getPhaseNumber(), getTLS(), and toString().

Referenced by TraCIServerAPI_TrafficLight::processSet().

Here is the caller graph for this function:

◆ setPhaseDuration()

void TrafficLight::setPhaseDuration ( const std::string &  tlsID,
const double  phaseDuration 
)
static

Definition at line 293 of file TrafficLight.cpp.

References MSTrafficLightLogic::changeStepAndDuration(), MSTLLogicControl::TLSLogicVariants::getActive(), MSTrafficLightLogic::getCurrentPhaseIndex(), MSNet::getCurrentTimeStep(), MSNet::getInstance(), getTLS(), and TIME2STEPS.

Referenced by TraCIServerAPI_TrafficLight::processSet().

Here is the caller graph for this function:

◆ setPhaseName()

void TrafficLight::setPhaseName ( const std::string &  tlsID,
const std::string &  name 
)
static

Definition at line 276 of file TrafficLight.cpp.

References MSTLLogicControl::TLSLogicVariants::getActive(), MSTrafficLightLogic::getCurrentPhaseDef(), and getTLS().

Referenced by TraCIServerAPI_TrafficLight::processSet().

Here is the caller graph for this function:

◆ setProgram()

void TrafficLight::setProgram ( const std::string &  tlsID,
const std::string &  programID 
)
static

Definition at line 283 of file TrafficLight.cpp.

References MSNet::getInstance(), getTLS(), and MSTLLogicControl::TLSLogicVariants::switchTo().

Referenced by TraCIServerAPI_TrafficLight::processSet().

Here is the caller graph for this function:

◆ setProgramLogic()

◆ setRedYellowGreenState()

void TrafficLight::setRedYellowGreenState ( const std::string &  tlsID,
const std::string &  state 
)
static

Definition at line 258 of file TrafficLight.cpp.

References MSNet::getInstance(), getTLS(), and MSTLLogicControl::TLSLogicVariants::setStateInstantiatingOnline().

Referenced by TraCIServerAPI_TrafficLight::processSet().

Here is the caller graph for this function:

Field Documentation

◆ myContextSubscriptionResults

ContextSubscriptionResults TrafficLight::myContextSubscriptionResults
staticprivate

Definition at line 101 of file TrafficLight.h.

Referenced by makeWrapper().

◆ mySubscriptionResults

SubscriptionResults TrafficLight::mySubscriptionResults
staticprivate

Definition at line 100 of file TrafficLight.h.

Referenced by makeWrapper().


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