![]() |
Eclipse SUMO - Simulation of Urban MObility
|
Scope for interaction with traffic lights. More...
#include <TraCIAPI.h>
Public Member Functions | |
void | clearSubscriptionResults () |
const libsumo::ContextSubscriptionResults | getAllContextSubscriptionResults () const |
std::vector< libsumo::TraCILogic > | getAllProgramLogics (const std::string &tlsID) const |
const libsumo::SubscriptionResults | getAllSubscriptionResults () const |
std::vector< libsumo::TraCILogic > | getCompleteRedYellowGreenDefinition (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::SubscriptionResults & | getModifiableContextSubscriptionResults (const std::string &objID) |
libsumo::SubscriptionResults & | getModifiableSubscriptionResults () |
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 | |
TraCIAPI & | myParent |
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 |
Scope for interaction with traffic lights.
Definition at line 461 of file TraCIAPI.h.
|
inline |
Definition at line 463 of file TraCIAPI.h.
|
inlinevirtual |
Definition at line 464 of file TraCIAPI.h.
|
inherited |
Definition at line 3897 of file TraCIAPI.cpp.
|
inherited |
Definition at line 3881 of file TraCIAPI.cpp.
std::vector< libsumo::TraCILogic > TraCIAPI::TrafficLightScope::getAllProgramLogics | ( | const std::string & | tlsID | ) | const |
Definition at line 1651 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().
|
inherited |
Definition at line 3865 of file TraCIAPI.cpp.
|
protectedinherited |
Definition at line 3567 of file TraCIAPI.cpp.
References libsumo::INVALID_INT_VALUE, and libsumo::TYPE_BYTE.
|
protectedinherited |
Definition at line 3683 of file TraCIAPI.cpp.
References libsumo::TraCIColor::a, libsumo::TraCIColor::b, libsumo::TraCIColor::g, libsumo::TraCIColor::r, and libsumo::TYPE_COLOR.
|
inline |
Definition at line 485 of file TraCIAPI.h.
References getAllProgramLogics().
|
inherited |
Definition at line 3887 of file TraCIAPI.cpp.
Referenced by TraCITestClient::testAPI().
std::vector< std::string > TraCIAPI::TrafficLightScope::getControlledLanes | ( | const std::string & | tlsID | ) | const |
Definition at line 1704 of file TraCIAPI.cpp.
References libsumo::TL_CONTROLLED_LANES.
Referenced by TraCITestClient::testAPI().
std::vector< std::vector< libsumo::TraCILink > > TraCIAPI::TrafficLightScope::getControlledLinks | ( | const std::string & | tlsID | ) | const |
Definition at line 1709 of file TraCIAPI.cpp.
References libsumo::CMD_GET_TL_VARIABLE, libsumo::TL_CONTROLLED_LINKS, and libsumo::TYPE_COMPOUND.
Referenced by TraCITestClient::testAPI().
|
protectedinherited |
Definition at line 3588 of file TraCIAPI.cpp.
References libsumo::INVALID_DOUBLE_VALUE, and libsumo::TYPE_DOUBLE.
Referenced by TraCIAPI::EdgeScope::getAdaptedTraveltime().
|
protectedinherited |
Definition at line 3669 of file TraCIAPI.cpp.
References libsumo::TYPE_DOUBLELIST.
|
inherited |
Definition at line 3752 of file TraCIAPI.cpp.
References libsumo::ID_COUNT.
Referenced by TraCITestClient::testAPI().
|
inherited |
Definition at line 3746 of file TraCIAPI.cpp.
References libsumo::TRACI_ID_LIST.
Referenced by TraCITestClient::testAPI().
|
protectedinherited |
Definition at line 3578 of file TraCIAPI.cpp.
References libsumo::INVALID_INT_VALUE, and libsumo::TYPE_INTEGER.
|
inherited |
Definition at line 3910 of file TraCIAPI.cpp.
|
inherited |
Definition at line 3904 of file TraCIAPI.cpp.
double TraCIAPI::TrafficLightScope::getNextSwitch | ( | const std::string & | tlsID | ) | const |
Definition at line 1757 of file TraCIAPI.cpp.
References libsumo::TL_NEXT_SWITCH.
Referenced by TraCITestClient::testAPI().
|
inherited |
retrieve generic parameter
Definition at line 3758 of file TraCIAPI.cpp.
References libsumo::TYPE_STRING, libsumo::VAR_PARAMETER, tcpip::Storage::writeByte(), and tcpip::Storage::writeString().
Referenced by TraCITestClient::testAPI().
|
inherited |
retrieve generic parameter and return (key, value) tuple
Definition at line 3767 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().
int TraCIAPI::TrafficLightScope::getPhase | ( | const std::string & | tlsID | ) | const |
Definition at line 1742 of file TraCIAPI.cpp.
References libsumo::TL_CURRENT_PHASE.
Referenced by TraCITestClient::testAPI().
double TraCIAPI::TrafficLightScope::getPhaseDuration | ( | const std::string & | tlsID | ) | const |
Definition at line 1752 of file TraCIAPI.cpp.
References libsumo::TL_PHASE_DURATION.
Referenced by TraCITestClient::testAPI().
std::string TraCIAPI::TrafficLightScope::getPhaseName | ( | const std::string & | tlsID | ) | const |
Definition at line 1747 of file TraCIAPI.cpp.
References libsumo::VAR_NAME.
Referenced by TraCITestClient::testAPI().
|
protectedinherited |
Definition at line 3598 of file TraCIAPI.cpp.
References libsumo::TYPE_POLYGON, libsumo::TraCIPositionVector::value, libsumo::TraCIPosition::x, libsumo::TraCIPosition::y, and libsumo::TraCIPosition::z.
|
protectedinherited |
Definition at line 3619 of file TraCIAPI.cpp.
References libsumo::POSITION_2D, libsumo::TraCIPosition::x, libsumo::TraCIPosition::y, and libsumo::TraCIPosition::z.
|
protectedinherited |
Definition at line 3632 of file TraCIAPI.cpp.
References libsumo::POSITION_3D, libsumo::TraCIPosition::x, libsumo::TraCIPosition::y, and libsumo::TraCIPosition::z.
std::string TraCIAPI::TrafficLightScope::getProgram | ( | const std::string & | tlsID | ) | const |
Definition at line 1737 of file TraCIAPI.cpp.
References libsumo::TL_CURRENT_PROGRAM.
Referenced by TraCITestClient::testAPI().
std::string TraCIAPI::TrafficLightScope::getRedYellowGreenState | ( | const std::string & | tlsID | ) | const |
Definition at line 1646 of file TraCIAPI.cpp.
References libsumo::TL_RED_YELLOW_GREEN_STATE.
Referenced by TraCITestClient::testAPI().
int TraCIAPI::TrafficLightScope::getServedPersonCount | ( | const std::string & | tlsID, |
int | index | ||
) | const |
Definition at line 1763 of file TraCIAPI.cpp.
References libsumo::TYPE_INTEGER, libsumo::VAR_PERSON_NUMBER, tcpip::Storage::writeByte(), and tcpip::Storage::writeInt().
|
protectedinherited |
Definition at line 3645 of file TraCIAPI.cpp.
References libsumo::TYPE_STRING.
|
protectedinherited |
Definition at line 3655 of file TraCIAPI.cpp.
References libsumo::TYPE_STRINGLIST.
|
inherited |
Definition at line 3871 of file TraCIAPI.cpp.
Referenced by TraCITestClient::testAPI().
|
protectedinherited |
Definition at line 3697 of file TraCIAPI.cpp.
References libsumo::TraCIStage::arrivalPos, libsumo::TraCIStage::cost, libsumo::TraCIStage::depart, libsumo::TraCIStage::departPos, libsumo::TraCIStage::description, libsumo::TraCIStage::destStop, libsumo::TraCIStage::edges, libsumo::TraCIStage::intended, libsumo::TraCIStage::length, libsumo::TraCIStage::line, libsumo::TraCIStage::travelTime, libsumo::TraCIStage::type, libsumo::TYPE_COMPOUND, and libsumo::TraCIStage::vType.
|
protectedinherited |
Definition at line 3557 of file TraCIAPI.cpp.
References libsumo::INVALID_INT_VALUE, and libsumo::TYPE_UBYTE.
|
inline |
Definition at line 488 of file TraCIAPI.h.
References setProgramLogic().
|
protectedinherited |
Definition at line 3810 of file TraCIAPI.cpp.
References libsumo::TYPE_DOUBLE, tcpip::Storage::writeDouble(), and tcpip::Storage::writeUnsignedByte().
|
protectedinherited |
Definition at line 3800 of file TraCIAPI.cpp.
References libsumo::TYPE_INTEGER, tcpip::Storage::writeInt(), and tcpip::Storage::writeUnsignedByte().
|
inherited |
set generic paramter
Definition at line 3786 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().
void TraCIAPI::TrafficLightScope::setPhase | ( | const std::string & | tlsID, |
int | index | ||
) | const |
Definition at line 1781 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().
void TraCIAPI::TrafficLightScope::setPhaseDuration | ( | const std::string & | tlsID, |
double | phaseDuration | ||
) | const |
Definition at line 1808 of file TraCIAPI.cpp.
References libsumo::CMD_SET_TL_VARIABLE, libsumo::TL_PHASE_DURATION, libsumo::TYPE_DOUBLE, tcpip::Storage::writeDouble(), and tcpip::Storage::writeUnsignedByte().
void TraCIAPI::TrafficLightScope::setPhaseName | ( | const std::string & | tlsID, |
const std::string & | name | ||
) | const |
Definition at line 1790 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().
void TraCIAPI::TrafficLightScope::setProgram | ( | const std::string & | tlsID, |
const std::string & | programID | ||
) | const |
Definition at line 1799 of file TraCIAPI.cpp.
References libsumo::CMD_SET_TL_VARIABLE, libsumo::TL_PROGRAM, libsumo::TYPE_STRING, tcpip::Storage::writeString(), and tcpip::Storage::writeUnsignedByte().
void TraCIAPI::TrafficLightScope::setProgramLogic | ( | const std::string & | tlsID, |
const libsumo::TraCILogic & | logic | ||
) | const |
Definition at line 1817 of file TraCIAPI.cpp.
References libsumo::CMD_SET_TL_VARIABLE, libsumo::TraCILogic::currentPhaseIndex, libsumo::TraCILogic::phases, libsumo::TraCILogic::programID, libsumo::TraCILogic::subParameter, libsumo::TL_COMPLETE_PROGRAM_RYG, libsumo::TraCILogic::type, libsumo::TYPE_COMPOUND, libsumo::TYPE_DOUBLE, libsumo::TYPE_INTEGER, libsumo::TYPE_STRING, libsumo::TYPE_STRINGLIST, tcpip::Storage::writeDouble(), tcpip::Storage::writeInt(), tcpip::Storage::writeString(), and tcpip::Storage::writeUnsignedByte().
Referenced by setCompleteRedYellowGreenDefinition(), and TraCITestClient::testAPI().
void TraCIAPI::TrafficLightScope::setRedYellowGreenState | ( | const std::string & | tlsID, |
const std::string & | state | ||
) | const |
Definition at line 1772 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().
|
protectedinherited |
Definition at line 3820 of file TraCIAPI.cpp.
References libsumo::TYPE_STRING, tcpip::Storage::writeString(), and tcpip::Storage::writeUnsignedByte().
|
protectedinherited |
Definition at line 3830 of file TraCIAPI.cpp.
References libsumo::TYPE_STRINGLIST, tcpip::Storage::writeInt(), tcpip::Storage::writeString(), and tcpip::Storage::writeUnsignedByte().
|
inherited |
Definition at line 3843 of file TraCIAPI.cpp.
Referenced by TraCITestClient::testAPI().
|
inherited |
Definition at line 3855 of file TraCIAPI.cpp.
Referenced by TraCITestClient::testAPI().
|
privateinherited |
Definition at line 154 of file TraCIAPI.h.
|
privateinherited |
Definition at line 155 of file TraCIAPI.h.
|
privateinherited |
Definition at line 157 of file TraCIAPI.h.
|
privateinherited |
Definition at line 159 of file TraCIAPI.h.
|
protectedinherited |
The parent TraCI client which offers the connection.
Definition at line 151 of file TraCIAPI.h.
|
privateinherited |
Definition at line 156 of file TraCIAPI.h.
|
privateinherited |
Definition at line 158 of file TraCIAPI.h.