Eclipse SUMO - Simulation of Urban MObility
Loading...
Searching...
No Matches
LIBSUMO_NAMESPACE::TrafficLight Class Reference

#include <TrafficLight.h>

Static Public Member Functions

static void addConstraint (const std::string &tlsID, const std::string &tripId, const std::string &foeSignal, const std::string &foeId, const int type=0, const int limit=0)
static std::vector< libsumo::TraCILogicgetAllProgramLogics (const std::string &tlsID)
static std::vector< std::string > getBlockingVehicles (const std::string &tlsID, int linkIndex)
static std::vector< libsumo::TraCILogicgetCompleteRedYellowGreenDefinition (const std::string &tlsID)
static std::vector< libsumo::TraCISignalConstraintgetConstraints (const std::string &tlsID, const std::string &tripId="")
static std::vector< libsumo::TraCISignalConstraintgetConstraintsByFoe (const std::string &foeSignal, const std::string &foeId="")
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< libsumo::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 double getSpentDuration (const std::string &tlsID)
static bool handleVariable (const std::string &objID, const int variable, VariableWrapper *wrapper, tcpip::Storage *paramData)
static std::shared_ptr< VariableWrapper > makeWrapper ()
static void removeConstraints (const std::string &tlsID, const std::string &tripId, const std::string &foeSignal, const std::string &foeId)
static void setCompleteRedYellowGreenDefinition (const std::string &tlsID, const libsumo::TraCILogic &logic)
static void setNemaCycleLength (const std::string &tlsID, double cycleLength)
static void setNemaMaxGreens (const std::string &tlsID, const std::vector< double > &maxGreens)
static void setNemaOffset (const std::string &tlsID, double offset)
static void setNemaSplits (const std::string &tlsID, const std::vector< double > &splits)
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 libsumo::TraCILogic &logic)
LIBSUMO_ID_PARAMETER_API static LIBSUMO_SUBSCRIPTION_API void setRedYellowGreenState (const std::string &tlsID, const std::string &state)
static std::vector< libsumo::TraCISignalConstraintswapConstraints (const std::string &tlsID, const std::string &tripId, const std::string &foeSignal, const std::string &foeId)
static void updateConstraints (const std::string &vehID, std::string tripId="")

Private Member Functions

 TrafficLight ()=delete
 invalidated standard constructor

Static Private Member Functions

static libsumo::TraCISignalConstraint buildConstraint (const std::string &tlsID, const std::string &tripId, MSRailSignalConstraint *constraint)
static std::vector< libsumo::TraCISignalConstraintfindConstraintsDeadLocks (const std::string &foeId, const std::string &tripId, const std::string &foeSignal, const std::string &tlsID)
 perform swapConstraints to resolve deadlocks and return the new constraints
static std::vector< std::string > getFutureTripIds (const std::string vehID)
static std::vector< std::pair< std::string, std::string > > getSwapParams (int constraintType)
static SUMOVehiclegetVehicleByTripId (const std::string tripOrVehID)
static void swapParameters (MSRailSignalConstraint *c)
static void swapParameters (MSRailSignalConstraint *c, const std::string &key1, const std::string &key2)
static void swapParameters (TraCISignalConstraint &c)
static void swapParameters (TraCISignalConstraint &c, const std::string &key1, const std::string &key2)

Static Private Attributes

static ContextSubscriptionResults myContextSubscriptionResults
static SubscriptionResults mySubscriptionResults

Detailed Description

Definition at line 43 of file TrafficLight.h.

Constructor & Destructor Documentation

◆ TrafficLight()

LIBSUMO_NAMESPACE::TrafficLight::TrafficLight ( )
privatedelete

invalidated standard constructor

Member Function Documentation

◆ addConstraint()

void TrafficLight::addConstraint ( const std::string & tlsID,
const std::string & tripId,
const std::string & foeSignal,
const std::string & foeId,
const int type = 0,
const int limit = 0 )
static

Definition at line 309 of file libsumo/TrafficLight.cpp.

References addConstraint(), MSRailSignal::addConstraint(), MSTLLogicControl::TLSLogicVariants::getDefault(), and libsumo::Helper::getTLS().

Referenced by addConstraint().

Here is the caller graph for this function:

◆ buildConstraint()

libsumo::TraCISignalConstraint TrafficLight::buildConstraint ( const std::string & tlsID,
const std::string & tripId,
MSRailSignalConstraint * constraint )
staticprivate

◆ findConstraintsDeadLocks()

std::vector< TraCISignalConstraint > TrafficLight::findConstraintsDeadLocks ( const std::string & foeId,
const std::string & tripId,
const std::string & foeSignal,
const std::string & tlsID )
staticprivate

◆ getAllProgramLogics()

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

Definition at line 78 of file libsumo/TrafficLight.cpp.

References MSTLLogicControl::TLSLogicVariants::getAllLogics(), getAllProgramLogics(), libsumo::Helper::getTLS(), and STEPS2TIME.

Referenced by getAllProgramLogics(), getCompleteRedYellowGreenDefinition(), and handleVariable().

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 223 of file libsumo/TrafficLight.cpp.

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

Referenced by getBlockingVehicles(), and handleVariable().

Here is the caller graph for this function:

◆ getCompleteRedYellowGreenDefinition()

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

Definition at line 81 of file TrafficLight.h.

References getAllProgramLogics().

◆ getConstraints()

std::vector< libsumo::TraCISignalConstraint > TrafficLight::getConstraints ( const std::string & tlsID,
const std::string & tripId = "" )
static

Definition at line 266 of file libsumo/TrafficLight.cpp.

References buildConstraint(), getConstraints(), MSRailSignal::getConstraints(), MSTLLogicControl::TLSLogicVariants::getDefault(), and libsumo::Helper::getTLS().

Referenced by getConstraints(), and handleVariable().

Here is the caller graph for this function:

◆ getConstraintsByFoe()

std::vector< libsumo::TraCISignalConstraint > TrafficLight::getConstraintsByFoe ( const std::string & foeSignal,
const std::string & foeId = "" )
static

Definition at line 285 of file libsumo/TrafficLight.cpp.

References buildConstraint(), MSRailSignal::getConstraints(), getConstraintsByFoe(), MSTLLogicControl::TLSLogicVariants::getDefault(), Named::getID(), libsumo::Helper::getTLS(), MSRailSignalConstraint_Predecessor::myFoeSignal, and MSRailSignalConstraint_Predecessor::myTripId.

Referenced by getConstraintsByFoe(), and handleVariable().

Here is the caller graph for this function:

◆ getControlledJunctions()

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

Definition at line 96 of file libsumo/TrafficLight.cpp.

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

Referenced by getControlledJunctions(), and handleVariable().

Here is the caller graph for this function:

◆ getControlledLanes()

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

Definition at line 109 of file libsumo/TrafficLight.cpp.

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

Referenced by getControlledLanes(), and handleVariable().

Here is the caller graph for this function:

◆ getControlledLinks()

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

Definition at line 122 of file libsumo/TrafficLight.cpp.

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

Referenced by getControlledLinks(), and handleVariable().

Here is the caller graph for this function:

◆ getFutureTripIds()

std::vector< std::string > TrafficLight::getFutureTripIds ( const std::string vehID)
staticprivate

Definition at line 785 of file libsumo/TrafficLight.cpp.

References getFutureTripIds(), MSNet::getInstance(), MSBaseVehicle::getParameter(), Parameterised::getParameter(), MSBaseVehicle::getStops(), MSVehicleControl::getVehicle(), and MSNet::getVehicleControl().

Referenced by findConstraintsDeadLocks(), and getFutureTripIds().

Here is the caller graph for this function:

◆ getNextSwitch()

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

Definition at line 170 of file libsumo/TrafficLight.cpp.

References getNextSwitch(), libsumo::Helper::getTLS(), and STEPS2TIME.

Referenced by getNextSwitch(), and handleVariable().

Here is the caller graph for this function:

◆ getPhase()

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

Definition at line 152 of file libsumo/TrafficLight.cpp.

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

Referenced by getPhase(), and handleVariable().

Here is the caller graph for this function:

◆ getPhaseDuration()

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

Definition at line 164 of file libsumo/TrafficLight.cpp.

References getPhaseDuration(), libsumo::Helper::getTLS(), and STEPS2TIME.

Referenced by getPhaseDuration(), and handleVariable().

Here is the caller graph for this function:

◆ getPhaseName()

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

Definition at line 158 of file libsumo/TrafficLight.cpp.

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

Referenced by getPhaseName(), and 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 252 of file libsumo/TrafficLight.cpp.

References MSTLLogicControl::TLSLogicVariants::getDefault(), MSTrafficLightLogic::getNumLinks(), getPriorityVehicles(), MSTrafficLightLogic::getPriorityVehicles(), libsumo::Helper::getTLS(), and toString().

Referenced by getPriorityVehicles(), and handleVariable().

Here is the caller graph for this function:

◆ getProgram()

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

Definition at line 146 of file libsumo/TrafficLight.cpp.

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

Referenced by getProgram(), and handleVariable().

Here is the caller graph for this function:

◆ getRedYellowGreenState()

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

Definition at line 72 of file libsumo/TrafficLight.cpp.

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

Referenced by getRedYellowGreenState(), and 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 238 of file libsumo/TrafficLight.cpp.

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

Referenced by getRivalVehicles(), and handleVariable().

Here is the caller graph for this function:

◆ getServedPersonCount()

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

◆ getSpentDuration()

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

Definition at line 176 of file libsumo/TrafficLight.cpp.

References getSpentDuration(), libsumo::Helper::getTLS(), and STEPS2TIME.

Referenced by getSpentDuration(), and handleVariable().

Here is the caller graph for this function:

◆ getSwapParams()

std::vector< std::pair< std::string, std::string > > TrafficLight::getSwapParams ( int constraintType)
staticprivate

Definition at line 370 of file libsumo/TrafficLight.cpp.

References MSRailSignalConstraint::BIDI_PREDECESSOR, and getSwapParams().

Referenced by getSwapParams(), swapParameters(), and swapParameters().

Here is the caller graph for this function:

◆ getVehicleByTripId()

SUMOVehicle * TrafficLight::getVehicleByTripId ( const std::string tripOrVehID)
staticprivate

Definition at line 772 of file libsumo/TrafficLight.cpp.

References Named::getID(), MSNet::getInstance(), Parameterised::getParameter(), SUMOTrafficObject::getParameter(), getVehicleByTripId(), MSNet::getVehicleControl(), MSVehicleControl::loadedVehBegin(), and MSVehicleControl::loadedVehEnd().

Referenced by findConstraintsDeadLocks(), and getVehicleByTripId().

Here is the caller graph for this function:

◆ handleVariable()

◆ makeWrapper()

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

Definition at line 983 of file libsumo/TrafficLight.cpp.

References handleVariable(), makeWrapper(), myContextSubscriptionResults, and mySubscriptionResults.

Referenced by makeWrapper().

Here is the caller graph for this function:

◆ removeConstraints()

void TrafficLight::removeConstraints ( const std::string & tlsID,
const std::string & tripId,
const std::string & foeSignal,
const std::string & foeId )
static

Definition at line 439 of file libsumo/TrafficLight.cpp.

References MSRailSignal::getConstraints(), MSTLLogicControl::TLSLogicVariants::getDefault(), Named::getID(), libsumo::Helper::getTLS(), MSRailSignalConstraint_Predecessor::myFoeSignal, MSRailSignalConstraint_Predecessor::myTripId, removeConstraints(), and MSRailSignalConstraint::setActive().

Referenced by removeConstraints().

Here is the caller graph for this function:

◆ setCompleteRedYellowGreenDefinition()

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

Definition at line 84 of file TrafficLight.h.

References setProgramLogic().

◆ setNemaCycleLength()

void TrafficLight::setNemaCycleLength ( const std::string & tlsID,
double cycleLength )
static

Definition at line 950 of file libsumo/TrafficLight.cpp.

References setNemaCycleLength(), and toString().

Referenced by setNemaCycleLength().

Here is the caller graph for this function:

◆ setNemaMaxGreens()

void TrafficLight::setNemaMaxGreens ( const std::string & tlsID,
const std::vector< double > & maxGreens )
static

Definition at line 945 of file libsumo/TrafficLight.cpp.

References setNemaMaxGreens(), and toString().

Referenced by setNemaMaxGreens().

Here is the caller graph for this function:

◆ setNemaOffset()

void TrafficLight::setNemaOffset ( const std::string & tlsID,
double offset )
static

Definition at line 955 of file libsumo/TrafficLight.cpp.

References setNemaOffset(), and toString().

Referenced by setNemaOffset().

Here is the caller graph for this function:

◆ setNemaSplits()

void TrafficLight::setNemaSplits ( const std::string & tlsID,
const std::vector< double > & splits )
static

Definition at line 940 of file libsumo/TrafficLight.cpp.

References setNemaSplits(), and toString().

Referenced by setNemaSplits().

Here is the caller graph for this function:

◆ setPhase()

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

Definition at line 823 of file libsumo/TrafficLight.cpp.

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

Referenced by setPhase().

Here is the caller graph for this function:

◆ setPhaseDuration()

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

Definition at line 852 of file libsumo/TrafficLight.cpp.

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

Referenced by setPhaseDuration().

Here is the caller graph for this function:

◆ setPhaseName()

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

Definition at line 835 of file libsumo/TrafficLight.cpp.

References MSTLLogicControl::TLSLogicVariants::getActive(), MSTrafficLightLogic::getCurrentPhaseDef(), libsumo::Helper::getTLS(), MSPhaseDefinition::setName(), and setPhaseName().

Referenced by setPhaseName().

Here is the caller graph for this function:

◆ setProgram()

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

Definition at line 842 of file libsumo/TrafficLight.cpp.

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

Referenced by setProgram().

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 817 of file libsumo/TrafficLight.cpp.

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

Referenced by setRedYellowGreenState().

Here is the caller graph for this function:

◆ swapConstraints()

std::vector< libsumo::TraCISignalConstraint > TrafficLight::swapConstraints ( const std::string & tlsID,
const std::string & tripId,
const std::string & foeSignal,
const std::string & foeId )
static

◆ swapParameters() [1/4]

void TrafficLight::swapParameters ( MSRailSignalConstraint * c)
staticprivate

Definition at line 388 of file libsumo/TrafficLight.cpp.

References getSwapParams(), MSRailSignalConstraint::getType(), and swapParameters().

Referenced by findConstraintsDeadLocks(), swapConstraints(), swapParameters(), swapParameters(), swapParameters(), and swapParameters().

Here is the caller graph for this function:

◆ swapParameters() [2/4]

void TrafficLight::swapParameters ( MSRailSignalConstraint * c,
const std::string & key1,
const std::string & key2 )
staticprivate

◆ swapParameters() [3/4]

void TrafficLight::swapParameters ( TraCISignalConstraint & c)
staticprivate

Definition at line 412 of file libsumo/TrafficLight.cpp.

References getSwapParams(), and swapParameters().

◆ swapParameters() [4/4]

void TrafficLight::swapParameters ( TraCISignalConstraint & c,
const std::string & key1,
const std::string & key2 )
staticprivate

Definition at line 420 of file libsumo/TrafficLight.cpp.

References swapParameters().

◆ updateConstraints()

Field Documentation

◆ myContextSubscriptionResults

ContextSubscriptionResults TrafficLight::myContextSubscriptionResults
staticprivate

Definition at line 113 of file TrafficLight.h.

Referenced by makeWrapper().

◆ mySubscriptionResults

SubscriptionResults TrafficLight::mySubscriptionResults
staticprivate

Definition at line 112 of file TrafficLight.h.

Referenced by makeWrapper().


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