Eclipse SUMO - Simulation of Urban MObility
TraCIAPI::TrafficLightScope Class Reference

Scope for interaction with traffic lights. More...

#include <TraCIAPI.h>

Inheritance diagram for TraCIAPI::TrafficLightScope:
[legend]
Collaboration diagram for TraCIAPI::TrafficLightScope:
[legend]

Public Member Functions

void clearSubscriptionResults ()
 
const libsumo::ContextSubscriptionResults getAllContextSubscriptionResults () const
 
std::vector< libsumo::TraCILogicgetAllProgramLogics (const std::string &tlsID) const
 
const libsumo::SubscriptionResults getAllSubscriptionResults () const
 
std::vector< libsumo::TraCILogicgetCompleteRedYellowGreenDefinition (const std::string &tlsID) const
 
const libsumo::SubscriptionResults getContextSubscriptionResults (const std::string &objID) const
 
std::vector< std::string > getControlledLanes (const std::string &tlsID) const
 
std::vector< std::vector< libsumo::TraCILink > > getControlledLinks (const std::string &tlsID) const
 
int getIDCount () const
 
std::vector< std::string > getIDList () const
 
libsumo::SubscriptionResultsgetModifiableContextSubscriptionResults (const std::string &objID)
 
libsumo::SubscriptionResultsgetModifiableSubscriptionResults ()
 
double getNextSwitch (const std::string &tlsID) const
 
std::string getParameter (const std::string &objectID, const std::string &key) const
 retrieve generic parameter More...
 
std::pair< std::string, std::string > getParameterWithKey (const std::string &objectID, const std::string &key) const
 retrieve generic parameter and return (key, value) tuple More...
 
int getPhase (const std::string &tlsID) const
 
double getPhaseDuration (const std::string &tlsID) const
 
std::string getPhaseName (const std::string &tlsID) const
 
std::string getProgram (const std::string &tlsID) const
 
std::string getRedYellowGreenState (const std::string &tlsID) const
 
int getServedPersonCount (const std::string &tlsID, int index) const
 
const libsumo::TraCIResults getSubscriptionResults (const std::string &objID) const
 
void setCompleteRedYellowGreenDefinition (const std::string &tlsID, const libsumo::TraCILogic &logic) const
 
void setParameter (const std::string &objectID, const std::string &key, const std::string &value) const
 set generic paramter More...
 
void setPhase (const std::string &tlsID, int index) const
 
void setPhaseDuration (const std::string &tlsID, double phaseDuration) const
 
void setPhaseName (const std::string &tlsID, const std::string &name) const
 
void setProgram (const std::string &tlsID, const std::string &programID) const
 
void setProgramLogic (const std::string &tlsID, const libsumo::TraCILogic &logic) const
 
void setRedYellowGreenState (const std::string &tlsID, const std::string &state) const
 
void subscribe (const std::string &objID, const std::vector< int > &vars, double beginTime, double endTime) const
 
void subscribeContext (const std::string &objID, int domain, double range, const std::vector< int > &vars, double beginTime, double endTime) const
 
 TrafficLightScope (TraCIAPI &parent)
 
virtual ~TrafficLightScope ()
 

Protected Member Functions

int getByte (int var, const std::string &id, tcpip::Storage *add=0) const
 
libsumo::TraCIColor getCol (int var, const std::string &id, tcpip::Storage *add=0) const
 
double getDouble (int var, const std::string &id, tcpip::Storage *add=0) const
 
std::vector< double > getDoubleVector (int var, const std::string &id, tcpip::Storage *add=0) const
 
int getInt (int var, const std::string &id, tcpip::Storage *add=0) const
 
libsumo::TraCIPositionVector getPolygon (int var, const std::string &id, tcpip::Storage *add=0) const
 
libsumo::TraCIPosition getPos (int var, const std::string &id, tcpip::Storage *add=0) const
 
libsumo::TraCIPosition getPos3D (int var, const std::string &id, tcpip::Storage *add=0) const
 
std::string getString (int var, const std::string &id, tcpip::Storage *add=0) const
 
std::vector< std::string > getStringVector (int var, const std::string &id, tcpip::Storage *add=0) const
 
libsumo::TraCIStage getTraCIStage (int var, const std::string &id, tcpip::Storage *add=0) const
 
int getUnsignedByte (int var, const std::string &id, tcpip::Storage *add=0) const
 
void setDouble (int var, const std::string &id, double value) const
 
void setInt (int var, const std::string &id, int value) const
 
void setString (int var, const std::string &id, const std::string &value) const
 
void setStringVector (int var, const std::string &id, const std::vector< std::string > &value) const
 

Protected Attributes

TraCIAPImyParent
 The parent TraCI client which offers the connection. More...
 

Private Attributes

int myCmdGetID
 
int myCmdSetID
 
int myContextSubscribeID
 
libsumo::ContextSubscriptionResults myContextSubscriptionResults
 
int mySubscribeID
 
libsumo::SubscriptionResults mySubscriptionResults
 

Detailed Description

Scope for interaction with traffic lights.

Definition at line 466 of file TraCIAPI.h.

Constructor & Destructor Documentation

◆ TrafficLightScope()

TraCIAPI::TrafficLightScope::TrafficLightScope ( TraCIAPI parent)
inline

Definition at line 468 of file TraCIAPI.h.

◆ ~TrafficLightScope()

virtual TraCIAPI::TrafficLightScope::~TrafficLightScope ( )
inlinevirtual

Definition at line 469 of file TraCIAPI.h.

Member Function Documentation

◆ clearSubscriptionResults()

void TraCIAPI::TraCIScopeWrapper::clearSubscriptionResults ( )
inherited

Definition at line 3894 of file TraCIAPI.cpp.

◆ getAllContextSubscriptionResults()

const libsumo::ContextSubscriptionResults TraCIAPI::TraCIScopeWrapper::getAllContextSubscriptionResults ( ) const
inherited

Definition at line 3878 of file TraCIAPI.cpp.

◆ getAllProgramLogics()

std::vector< libsumo::TraCILogic > TraCIAPI::TrafficLightScope::getAllProgramLogics ( const std::string &  tlsID) const

Definition at line 1648 of file TraCIAPI.cpp.

References libsumo::CMD_GET_TL_VARIABLE, libsumo::TraCILogic::phases, libsumo::TraCILogic::subParameter, libsumo::TL_COMPLETE_DEFINITION_RYG, and libsumo::TYPE_COMPOUND.

Referenced by getCompleteRedYellowGreenDefinition(), and TraCITestClient::testAPI().

Here is the caller graph for this function:

◆ getAllSubscriptionResults()

const libsumo::SubscriptionResults TraCIAPI::TraCIScopeWrapper::getAllSubscriptionResults ( ) const
inherited

Definition at line 3862 of file TraCIAPI.cpp.

◆ getByte()

int TraCIAPI::TraCIScopeWrapper::getByte ( int  var,
const std::string &  id,
tcpip::Storage add = 0 
) const
protectedinherited

Definition at line 3564 of file TraCIAPI.cpp.

References libsumo::INVALID_INT_VALUE, and libsumo::TYPE_BYTE.

◆ getCol()

libsumo::TraCIColor TraCIAPI::TraCIScopeWrapper::getCol ( int  var,
const std::string &  id,
tcpip::Storage add = 0 
) const
protectedinherited

◆ getCompleteRedYellowGreenDefinition()

std::vector<libsumo::TraCILogic> TraCIAPI::TrafficLightScope::getCompleteRedYellowGreenDefinition ( const std::string &  tlsID) const
inline

Definition at line 490 of file TraCIAPI.h.

References getAllProgramLogics().

◆ getContextSubscriptionResults()

const libsumo::SubscriptionResults TraCIAPI::TraCIScopeWrapper::getContextSubscriptionResults ( const std::string &  objID) const
inherited

Definition at line 3884 of file TraCIAPI.cpp.

Referenced by TraCITestClient::testAPI().

Here is the caller graph for this function:

◆ getControlledLanes()

std::vector< std::string > TraCIAPI::TrafficLightScope::getControlledLanes ( const std::string &  tlsID) const

Definition at line 1701 of file TraCIAPI.cpp.

References libsumo::TL_CONTROLLED_LANES.

Referenced by TraCITestClient::testAPI().

Here is the caller graph for this function:

◆ getControlledLinks()

std::vector< std::vector< libsumo::TraCILink > > TraCIAPI::TrafficLightScope::getControlledLinks ( const std::string &  tlsID) const

Definition at line 1706 of file TraCIAPI.cpp.

References libsumo::CMD_GET_TL_VARIABLE, libsumo::TL_CONTROLLED_LINKS, and libsumo::TYPE_COMPOUND.

Referenced by TraCITestClient::testAPI().

Here is the caller graph for this function:

◆ getDouble()

double TraCIAPI::TraCIScopeWrapper::getDouble ( int  var,
const std::string &  id,
tcpip::Storage add = 0 
) const
protectedinherited

Definition at line 3585 of file TraCIAPI.cpp.

References libsumo::INVALID_DOUBLE_VALUE, and libsumo::TYPE_DOUBLE.

Referenced by TraCIAPI::EdgeScope::getAdaptedTraveltime().

Here is the caller graph for this function:

◆ getDoubleVector()

std::vector< double > TraCIAPI::TraCIScopeWrapper::getDoubleVector ( int  var,
const std::string &  id,
tcpip::Storage add = 0 
) const
protectedinherited

Definition at line 3666 of file TraCIAPI.cpp.

References libsumo::TYPE_DOUBLELIST.

◆ getIDCount()

int TraCIAPI::TraCIScopeWrapper::getIDCount ( ) const
inherited

Definition at line 3749 of file TraCIAPI.cpp.

References libsumo::ID_COUNT.

Referenced by TraCITestClient::testAPI().

Here is the caller graph for this function:

◆ getIDList()

std::vector< std::string > TraCIAPI::TraCIScopeWrapper::getIDList ( ) const
inherited

Definition at line 3743 of file TraCIAPI.cpp.

References libsumo::TRACI_ID_LIST.

Referenced by TraCITestClient::testAPI().

Here is the caller graph for this function:

◆ getInt()

int TraCIAPI::TraCIScopeWrapper::getInt ( int  var,
const std::string &  id,
tcpip::Storage add = 0 
) const
protectedinherited

Definition at line 3575 of file TraCIAPI.cpp.

References libsumo::INVALID_INT_VALUE, and libsumo::TYPE_INTEGER.

◆ getModifiableContextSubscriptionResults()

libsumo::SubscriptionResults & TraCIAPI::TraCIScopeWrapper::getModifiableContextSubscriptionResults ( const std::string &  objID)
inherited

Definition at line 3907 of file TraCIAPI.cpp.

◆ getModifiableSubscriptionResults()

libsumo::SubscriptionResults & TraCIAPI::TraCIScopeWrapper::getModifiableSubscriptionResults ( )
inherited

Definition at line 3901 of file TraCIAPI.cpp.

◆ getNextSwitch()

double TraCIAPI::TrafficLightScope::getNextSwitch ( const std::string &  tlsID) const

Definition at line 1754 of file TraCIAPI.cpp.

References libsumo::TL_NEXT_SWITCH.

Referenced by TraCITestClient::testAPI().

Here is the caller graph for this function:

◆ getParameter()

std::string TraCIAPI::TraCIScopeWrapper::getParameter ( const std::string &  objectID,
const std::string &  key 
) const
inherited

retrieve generic parameter

Definition at line 3755 of file TraCIAPI.cpp.

References libsumo::TYPE_STRING, libsumo::VAR_PARAMETER, tcpip::Storage::writeByte(), and tcpip::Storage::writeString().

Referenced by TraCITestClient::testAPI().

Here is the caller graph for this function:

◆ getParameterWithKey()

std::pair< std::string, std::string > TraCIAPI::TraCIScopeWrapper::getParameterWithKey ( const std::string &  objectID,
const std::string &  key 
) const
inherited

retrieve generic parameter and return (key, value) tuple

Definition at line 3764 of file TraCIAPI.cpp.

References libsumo::TYPE_COMPOUND, libsumo::TYPE_STRING, libsumo::VAR_PARAMETER_WITH_KEY, tcpip::Storage::writeString(), and tcpip::Storage::writeUnsignedByte().

Referenced by TraCITestClient::testAPI().

Here is the caller graph for this function:

◆ getPhase()

int TraCIAPI::TrafficLightScope::getPhase ( const std::string &  tlsID) const

Definition at line 1739 of file TraCIAPI.cpp.

References libsumo::TL_CURRENT_PHASE.

Referenced by TraCITestClient::testAPI().

Here is the caller graph for this function:

◆ getPhaseDuration()

double TraCIAPI::TrafficLightScope::getPhaseDuration ( const std::string &  tlsID) const

Definition at line 1749 of file TraCIAPI.cpp.

References libsumo::TL_PHASE_DURATION.

Referenced by TraCITestClient::testAPI().

Here is the caller graph for this function:

◆ getPhaseName()

std::string TraCIAPI::TrafficLightScope::getPhaseName ( const std::string &  tlsID) const

Definition at line 1744 of file TraCIAPI.cpp.

References libsumo::VAR_NAME.

Referenced by TraCITestClient::testAPI().

Here is the caller graph for this function:

◆ getPolygon()

libsumo::TraCIPositionVector TraCIAPI::TraCIScopeWrapper::getPolygon ( int  var,
const std::string &  id,
tcpip::Storage add = 0 
) const
protectedinherited

◆ getPos()

libsumo::TraCIPosition TraCIAPI::TraCIScopeWrapper::getPos ( int  var,
const std::string &  id,
tcpip::Storage add = 0 
) const
protectedinherited

◆ getPos3D()

libsumo::TraCIPosition TraCIAPI::TraCIScopeWrapper::getPos3D ( int  var,
const std::string &  id,
tcpip::Storage add = 0 
) const
protectedinherited

◆ getProgram()

std::string TraCIAPI::TrafficLightScope::getProgram ( const std::string &  tlsID) const

Definition at line 1734 of file TraCIAPI.cpp.

References libsumo::TL_CURRENT_PROGRAM.

Referenced by TraCITestClient::testAPI().

Here is the caller graph for this function:

◆ getRedYellowGreenState()

std::string TraCIAPI::TrafficLightScope::getRedYellowGreenState ( const std::string &  tlsID) const

Definition at line 1643 of file TraCIAPI.cpp.

References libsumo::TL_RED_YELLOW_GREEN_STATE.

Referenced by TraCITestClient::testAPI().

Here is the caller graph for this function:

◆ getServedPersonCount()

int TraCIAPI::TrafficLightScope::getServedPersonCount ( const std::string &  tlsID,
int  index 
) const

◆ getString()

std::string TraCIAPI::TraCIScopeWrapper::getString ( int  var,
const std::string &  id,
tcpip::Storage add = 0 
) const
protectedinherited

Definition at line 3642 of file TraCIAPI.cpp.

References libsumo::TYPE_STRING.

◆ getStringVector()

std::vector< std::string > TraCIAPI::TraCIScopeWrapper::getStringVector ( int  var,
const std::string &  id,
tcpip::Storage add = 0 
) const
protectedinherited

Definition at line 3652 of file TraCIAPI.cpp.

References libsumo::TYPE_STRINGLIST.

◆ getSubscriptionResults()

const libsumo::TraCIResults TraCIAPI::TraCIScopeWrapper::getSubscriptionResults ( const std::string &  objID) const
inherited

Definition at line 3868 of file TraCIAPI.cpp.

Referenced by TraCITestClient::testAPI().

Here is the caller graph for this function:

◆ getTraCIStage()

◆ getUnsignedByte()

int TraCIAPI::TraCIScopeWrapper::getUnsignedByte ( int  var,
const std::string &  id,
tcpip::Storage add = 0 
) const
protectedinherited

Definition at line 3554 of file TraCIAPI.cpp.

References libsumo::INVALID_INT_VALUE, and libsumo::TYPE_UBYTE.

◆ setCompleteRedYellowGreenDefinition()

void TraCIAPI::TrafficLightScope::setCompleteRedYellowGreenDefinition ( const std::string &  tlsID,
const libsumo::TraCILogic logic 
) const
inline

Definition at line 493 of file TraCIAPI.h.

References setProgramLogic().

◆ setDouble()

void TraCIAPI::TraCIScopeWrapper::setDouble ( int  var,
const std::string &  id,
double  value 
) const
protectedinherited

◆ setInt()

void TraCIAPI::TraCIScopeWrapper::setInt ( int  var,
const std::string &  id,
int  value 
) const
protectedinherited

◆ setParameter()

void TraCIAPI::TraCIScopeWrapper::setParameter ( const std::string &  objectID,
const std::string &  key,
const std::string &  value 
) const
inherited

set generic paramter

Definition at line 3783 of file TraCIAPI.cpp.

References libsumo::TYPE_COMPOUND, libsumo::TYPE_STRING, libsumo::VAR_PARAMETER, tcpip::Storage::writeInt(), tcpip::Storage::writeString(), and tcpip::Storage::writeUnsignedByte().

Referenced by TraCITestClient::testAPI().

Here is the caller graph for this function:

◆ setPhase()

void TraCIAPI::TrafficLightScope::setPhase ( const std::string &  tlsID,
int  index 
) const

Definition at line 1778 of file TraCIAPI.cpp.

References libsumo::CMD_SET_TL_VARIABLE, libsumo::TL_PHASE_INDEX, libsumo::TYPE_INTEGER, tcpip::Storage::writeInt(), and tcpip::Storage::writeUnsignedByte().

Referenced by TraCITestClient::testAPI().

Here is the caller graph for this function:

◆ setPhaseDuration()

void TraCIAPI::TrafficLightScope::setPhaseDuration ( const std::string &  tlsID,
double  phaseDuration 
) const

◆ setPhaseName()

void TraCIAPI::TrafficLightScope::setPhaseName ( const std::string &  tlsID,
const std::string &  name 
) const

Definition at line 1787 of file TraCIAPI.cpp.

References libsumo::CMD_SET_TL_VARIABLE, libsumo::TYPE_STRING, libsumo::VAR_NAME, tcpip::Storage::writeString(), and tcpip::Storage::writeUnsignedByte().

Referenced by TraCITestClient::testAPI().

Here is the caller graph for this function:

◆ setProgram()

void TraCIAPI::TrafficLightScope::setProgram ( const std::string &  tlsID,
const std::string &  programID 
) const

◆ setProgramLogic()

◆ setRedYellowGreenState()

void TraCIAPI::TrafficLightScope::setRedYellowGreenState ( const std::string &  tlsID,
const std::string &  state 
) const

Definition at line 1769 of file TraCIAPI.cpp.

References libsumo::CMD_SET_TL_VARIABLE, libsumo::TL_RED_YELLOW_GREEN_STATE, libsumo::TYPE_STRING, tcpip::Storage::writeString(), and tcpip::Storage::writeUnsignedByte().

Referenced by TraCITestClient::testAPI().

Here is the caller graph for this function:

◆ setString()

void TraCIAPI::TraCIScopeWrapper::setString ( int  var,
const std::string &  id,
const std::string &  value 
) const
protectedinherited

◆ setStringVector()

void TraCIAPI::TraCIScopeWrapper::setStringVector ( int  var,
const std::string &  id,
const std::vector< std::string > &  value 
) const
protectedinherited

◆ subscribe()

void TraCIAPI::TraCIScopeWrapper::subscribe ( const std::string &  objID,
const std::vector< int > &  vars,
double  beginTime,
double  endTime 
) const
inherited

Definition at line 3840 of file TraCIAPI.cpp.

Referenced by TraCITestClient::testAPI().

Here is the caller graph for this function:

◆ subscribeContext()

void TraCIAPI::TraCIScopeWrapper::subscribeContext ( const std::string &  objID,
int  domain,
double  range,
const std::vector< int > &  vars,
double  beginTime,
double  endTime 
) const
inherited

Definition at line 3852 of file TraCIAPI.cpp.

Referenced by TraCITestClient::testAPI().

Here is the caller graph for this function:

Field Documentation

◆ myCmdGetID

int TraCIAPI::TraCIScopeWrapper::myCmdGetID
privateinherited

Definition at line 154 of file TraCIAPI.h.

◆ myCmdSetID

int TraCIAPI::TraCIScopeWrapper::myCmdSetID
privateinherited

Definition at line 155 of file TraCIAPI.h.

◆ myContextSubscribeID

int TraCIAPI::TraCIScopeWrapper::myContextSubscribeID
privateinherited

Definition at line 157 of file TraCIAPI.h.

◆ myContextSubscriptionResults

libsumo::ContextSubscriptionResults TraCIAPI::TraCIScopeWrapper::myContextSubscriptionResults
privateinherited

Definition at line 159 of file TraCIAPI.h.

◆ myParent

TraCIAPI& TraCIAPI::TraCIScopeWrapper::myParent
protectedinherited

The parent TraCI client which offers the connection.

Definition at line 151 of file TraCIAPI.h.

◆ mySubscribeID

int TraCIAPI::TraCIScopeWrapper::mySubscribeID
privateinherited

Definition at line 156 of file TraCIAPI.h.

◆ mySubscriptionResults

libsumo::SubscriptionResults TraCIAPI::TraCIScopeWrapper::mySubscriptionResults
privateinherited

Definition at line 158 of file TraCIAPI.h.


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