![]() |
SUMO - Simulation of Urban MObility
|
Scope for interaction with vehicles. More...
#include <TraCIAPI.h>
Public Member Functions | |
void | add (const std::string &personID, const std::string &edgeID, double pos, double depart=DEPARTFLAG_NOW, const std::string typeID="DEFAULT_PEDTYPE") |
void | appendDrivingStage (const std::string &personID, const std::string &toEdge, const std::string &lines, const std::string &stopID="") |
void | appendWaitingStage (const std::string &personID, double duration, const std::string &description="waiting", const std::string &stopID="") |
void | appendWalkingStage (const std::string &personID, const std::vector< std::string > &edges, double arrivalPos, double duration=-1, double speed=-1, const std::string &stopID="") |
void | clearSubscriptionResults () |
const libsumo::ContextSubscriptionResults | getAllContextSubscriptionResults () const |
const libsumo::SubscriptionResults | getAllSubscriptionResults () const |
double | getAngle (const std::string &personID) const |
libsumo::TraCIColor | getColor (const std::string &personID) const |
const libsumo::SubscriptionResults | getContextSubscriptionResults (const std::string &objID) const |
std::vector< std::string > | getEdges (const std::string &personID, int nextStageIndex=0) const |
int | getIDCount () const |
std::vector< std::string > | getIDList () const |
double | getLanePosition (const std::string &personID) const |
libsumo::SubscriptionResults & | getModifiableContextSubscriptionResults (const std::string &objID) |
libsumo::SubscriptionResults & | getModifiableSubscriptionResults () |
std::string | getNextEdge (const std::string &personID) const |
std::string | getParameter (const std::string &objectID, const std::string &key) const |
retrieve generic paramter More... | |
libsumo::TraCIPosition | getPosition (const std::string &personID) const |
libsumo::TraCIPosition | getPosition3D (const std::string &personID) const |
int | getRemainingStages (const std::string &personID) const |
std::string | getRoadID (const std::string &personID) const |
double | getSpeed (const std::string &personID) const |
int | getStage (const std::string &personID, int nextStageIndex=0) const |
const libsumo::TraCIResults | getSubscriptionResults (const std::string &objID) const |
std::string | getTypeID (const std::string &personID) const |
std::string | getVehicle (const std::string &personID) const |
double | getWaitingTime (const std::string &personID) const |
PersonScope (TraCIAPI &parent) | |
void | removeStage (const std::string &personID, int nextStageIndex) const |
void | removeStages (const std::string &personID) const |
void | rerouteTraveltime (const std::string &personID) const |
void | setColor (const std::string &personID, const libsumo::TraCIColor &c) const |
void | setHeight (const std::string &personID, double height) const |
void | setLength (const std::string &personID, double length) const |
void | setMinGap (const std::string &personID, double minGap) const |
void | setParameter (const std::string &objectID, const std::string &key, const std::string &value) const |
set generic paramter More... | |
void | setSpeed (const std::string &personID, double speed) const |
void | setType (const std::string &personID, const std::string &typeID) const |
void | setWidth (const std::string &personID, double width) 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 |
virtual | ~PersonScope () |
vehicle type value retrieval shortcuts | |
double | getLength (const std::string &personID) const |
Protected Attributes | |
int | myCmdGetID |
int | myCmdSetID |
int | myContextSubscribeID |
libsumo::ContextSubscriptionResults | myContextSubscriptionResults |
TraCIAPI & | myParent |
The parent TraCI client which offers the connection. More... | |
int | mySubscribeID |
libsumo::SubscriptionResults | mySubscriptionResults |
Private Member Functions | |
PersonScope & | operator= (const PersonScope &src) |
invalidated assignment operator More... | |
PersonScope (const PersonScope &src) | |
invalidated copy constructor More... | |
|
inline |
Definition at line 800 of file TraCIAPI.h.
|
inlinevirtual |
Definition at line 801 of file TraCIAPI.h.
References DEPARTFLAG_NOW, TraCIAPI::getColor(), TraCIAPI::getPosition(), TraCIAPI::getPosition3D(), and TraCIAPI::TraCIScopeWrapper::operator=().
|
private |
invalidated copy constructor
void TraCIAPI::PersonScope::add | ( | const std::string & | personID, |
const std::string & | edgeID, | ||
double | pos, | ||
double | depart = DEPARTFLAG_NOW , |
||
const std::string | typeID = "DEFAULT_PEDTYPE" |
||
) |
Definition at line 3067 of file TraCIAPI.cpp.
References ADD, CMD_SET_PERSON_VARIABLE, TYPE_COMPOUND, TYPE_DOUBLE, TYPE_STRING, tcpip::Storage::writeDouble(), tcpip::Storage::writeInt(), tcpip::Storage::writeString(), and tcpip::Storage::writeUnsignedByte().
Referenced by TraCITestClient::testAPI().
void TraCIAPI::PersonScope::appendDrivingStage | ( | const std::string & | personID, |
const std::string & | toEdge, | ||
const std::string & | lines, | ||
const std::string & | stopID = "" |
||
) |
Definition at line 3129 of file TraCIAPI.cpp.
References APPEND_STAGE, CMD_SET_PERSON_VARIABLE, STAGE_DRIVING, TYPE_COMPOUND, TYPE_INTEGER, TYPE_STRING, tcpip::Storage::writeInt(), tcpip::Storage::writeString(), and tcpip::Storage::writeUnsignedByte().
Referenced by TraCITestClient::testAPI().
void TraCIAPI::PersonScope::appendWaitingStage | ( | const std::string & | personID, |
double | duration, | ||
const std::string & | description = "waiting" , |
||
const std::string & | stopID = "" |
||
) |
Definition at line 3085 of file TraCIAPI.cpp.
References APPEND_STAGE, CMD_SET_PERSON_VARIABLE, STAGE_WAITING, TYPE_COMPOUND, TYPE_INTEGER, TYPE_STRING, tcpip::Storage::writeInt(), tcpip::Storage::writeString(), and tcpip::Storage::writeUnsignedByte().
Referenced by TraCITestClient::testAPI().
void TraCIAPI::PersonScope::appendWalkingStage | ( | const std::string & | personID, |
const std::vector< std::string > & | edges, | ||
double | arrivalPos, | ||
double | duration = -1 , |
||
double | speed = -1 , |
||
const std::string & | stopID = "" |
||
) |
Definition at line 3104 of file TraCIAPI.cpp.
References APPEND_STAGE, CMD_SET_PERSON_VARIABLE, STAGE_WALKING, TYPE_COMPOUND, TYPE_DOUBLE, TYPE_INTEGER, TYPE_STRING, TYPE_STRINGLIST, tcpip::Storage::writeDouble(), tcpip::Storage::writeInt(), tcpip::Storage::writeString(), tcpip::Storage::writeStringList(), and tcpip::Storage::writeUnsignedByte().
Referenced by TraCITestClient::testAPI().
|
inherited |
Definition at line 3313 of file TraCIAPI.cpp.
Referenced by TraCIAPI::TraCIScopeWrapper::~TraCIScopeWrapper().
|
inherited |
Definition at line 3297 of file TraCIAPI.cpp.
Referenced by TraCIAPI::TraCIScopeWrapper::~TraCIScopeWrapper().
|
inherited |
Definition at line 3281 of file TraCIAPI.cpp.
Referenced by TraCIAPI::TraCIScopeWrapper::~TraCIScopeWrapper().
double TraCIAPI::PersonScope::getAngle | ( | const std::string & | personID | ) | const |
Definition at line 2980 of file TraCIAPI.cpp.
References CMD_GET_PERSON_VARIABLE, and VAR_ANGLE.
Referenced by TraCITestClient::testAPI().
libsumo::TraCIColor TraCIAPI::PersonScope::getColor | ( | const std::string & | personID | ) | const |
Definition at line 2990 of file TraCIAPI.cpp.
References CMD_GET_PERSON_VARIABLE, and VAR_COLOR.
Referenced by TraCITestClient::testAPI().
|
inherited |
Definition at line 3303 of file TraCIAPI.cpp.
Referenced by TraCITestClient::testAPI(), and TraCIAPI::TraCIScopeWrapper::~TraCIScopeWrapper().
std::vector< std::string > TraCIAPI::PersonScope::getEdges | ( | const std::string & | personID, |
int | nextStageIndex = 0 |
||
) | const |
Definition at line 3039 of file TraCIAPI.cpp.
References CMD_GET_PERSON_VARIABLE, TYPE_INTEGER, VAR_EDGES, tcpip::Storage::writeByte(), and tcpip::Storage::writeInt().
Referenced by TraCITestClient::testAPI().
int TraCIAPI::PersonScope::getIDCount | ( | ) | const |
Definition at line 2960 of file TraCIAPI.cpp.
References CMD_GET_PERSON_VARIABLE, and ID_COUNT.
std::vector< std::string > TraCIAPI::PersonScope::getIDList | ( | ) | const |
Definition at line 2955 of file TraCIAPI.cpp.
References CMD_GET_PERSON_VARIABLE, and TRACI_ID_LIST.
Referenced by TraCITestClient::testAPI().
double TraCIAPI::PersonScope::getLanePosition | ( | const std::string & | personID | ) | const |
Definition at line 2985 of file TraCIAPI.cpp.
References CMD_GET_PERSON_VARIABLE, and VAR_LANEPOSITION.
Referenced by TraCITestClient::testAPI().
double TraCIAPI::PersonScope::getLength | ( | const std::string & | personID | ) | const |
Definition at line 2995 of file TraCIAPI.cpp.
References CMD_GET_PERSON_VARIABLE, and VAR_LENGTH.
Referenced by TraCITestClient::testAPI().
|
inherited |
Definition at line 3326 of file TraCIAPI.cpp.
Referenced by TraCIAPI::TraCIScopeWrapper::~TraCIScopeWrapper().
|
inherited |
Definition at line 3320 of file TraCIAPI.cpp.
Referenced by TraCIAPI::TraCIScopeWrapper::~TraCIScopeWrapper().
std::string TraCIAPI::PersonScope::getNextEdge | ( | const std::string & | personID | ) | const |
Definition at line 3015 of file TraCIAPI.cpp.
References CMD_GET_PERSON_VARIABLE, and VAR_NEXT_EDGE.
Referenced by TraCITestClient::testAPI().
|
inherited |
retrieve generic paramter
Definition at line 3235 of file TraCIAPI.cpp.
References TYPE_STRING, VAR_PARAMETER, tcpip::Storage::writeByte(), and tcpip::Storage::writeString().
Referenced by TraCITestClient::testAPI(), and TraCIAPI::TraCIScopeWrapper::~TraCIScopeWrapper().
libsumo::TraCIPosition TraCIAPI::PersonScope::getPosition | ( | const std::string & | personID | ) | const |
Definition at line 2970 of file TraCIAPI.cpp.
References CMD_GET_PERSON_VARIABLE, and VAR_POSITION.
Referenced by TraCITestClient::testAPI().
libsumo::TraCIPosition TraCIAPI::PersonScope::getPosition3D | ( | const std::string & | personID | ) | const |
Definition at line 2975 of file TraCIAPI.cpp.
References CMD_GET_PERSON_VARIABLE, and VAR_POSITION3D.
Referenced by TraCITestClient::testAPI().
int TraCIAPI::PersonScope::getRemainingStages | ( | const std::string & | personID | ) | const |
Definition at line 3026 of file TraCIAPI.cpp.
References CMD_GET_PERSON_VARIABLE, and VAR_STAGES_REMAINING.
Referenced by TraCITestClient::testAPI().
std::string TraCIAPI::PersonScope::getRoadID | ( | const std::string & | personID | ) | const |
Definition at line 3000 of file TraCIAPI.cpp.
References CMD_GET_PERSON_VARIABLE, and VAR_ROAD_ID.
Referenced by TraCITestClient::testAPI().
double TraCIAPI::PersonScope::getSpeed | ( | const std::string & | personID | ) | const |
Definition at line 2965 of file TraCIAPI.cpp.
References CMD_GET_PERSON_VARIABLE, and VAR_SPEED.
Referenced by TraCITestClient::testAPI().
int TraCIAPI::PersonScope::getStage | ( | const std::string & | personID, |
int | nextStageIndex = 0 |
||
) | const |
Definition at line 3031 of file TraCIAPI.cpp.
References CMD_GET_PERSON_VARIABLE, TYPE_INTEGER, VAR_STAGE, tcpip::Storage::writeByte(), and tcpip::Storage::writeInt().
Referenced by TraCITestClient::testAPI().
|
inherited |
Definition at line 3287 of file TraCIAPI.cpp.
Referenced by TraCITestClient::testAPI(), and TraCIAPI::TraCIScopeWrapper::~TraCIScopeWrapper().
std::string TraCIAPI::PersonScope::getTypeID | ( | const std::string & | personID | ) | const |
Definition at line 3005 of file TraCIAPI.cpp.
References CMD_GET_PERSON_VARIABLE, and VAR_TYPE.
Referenced by TraCITestClient::testAPI().
std::string TraCIAPI::PersonScope::getVehicle | ( | const std::string & | personID | ) | const |
Definition at line 3021 of file TraCIAPI.cpp.
References CMD_GET_PERSON_VARIABLE, and VAR_VEHICLE.
Referenced by TraCITestClient::testAPI().
double TraCIAPI::PersonScope::getWaitingTime | ( | const std::string & | personID | ) | const |
Definition at line 3010 of file TraCIAPI.cpp.
References CMD_GET_PERSON_VARIABLE, and VAR_WAITING_TIME.
Referenced by TraCITestClient::testAPI().
|
private |
invalidated assignment operator
void TraCIAPI::PersonScope::removeStage | ( | const std::string & | personID, |
int | nextStageIndex | ||
) | const |
Definition at line 3147 of file TraCIAPI.cpp.
References CMD_SET_PERSON_VARIABLE, REMOVE_STAGE, TYPE_INTEGER, tcpip::Storage::writeByte(), and tcpip::Storage::writeInt().
Referenced by TraCITestClient::testAPI().
void TraCIAPI::PersonScope::removeStages | ( | const std::string & | personID | ) | const |
Definition at line 3047 of file TraCIAPI.cpp.
Referenced by TraCITestClient::testAPI().
void TraCIAPI::PersonScope::rerouteTraveltime | ( | const std::string & | personID | ) | const |
Definition at line 3057 of file TraCIAPI.cpp.
References CMD_REROUTE_TRAVELTIME, CMD_SET_PERSON_VARIABLE, TYPE_COMPOUND, tcpip::Storage::writeInt(), and tcpip::Storage::writeUnsignedByte().
Referenced by TraCITestClient::testAPI().
void TraCIAPI::PersonScope::setColor | ( | const std::string & | personID, |
const libsumo::TraCIColor & | c | ||
) | const |
Definition at line 3221 of file TraCIAPI.cpp.
References libsumo::TraCIColor::a, libsumo::TraCIColor::b, CMD_SET_PERSON_VARIABLE, libsumo::TraCIColor::g, libsumo::TraCIColor::r, TYPE_COLOR, VAR_COLOR, and tcpip::Storage::writeUnsignedByte().
Referenced by TraCITestClient::testAPI().
void TraCIAPI::PersonScope::setHeight | ( | const std::string & | personID, |
double | height | ||
) | const |
Definition at line 3200 of file TraCIAPI.cpp.
References CMD_SET_PERSON_VARIABLE, TYPE_DOUBLE, VAR_HEIGHT, tcpip::Storage::writeDouble(), and tcpip::Storage::writeUnsignedByte().
Referenced by TraCITestClient::testAPI().
void TraCIAPI::PersonScope::setLength | ( | const std::string & | personID, |
double | length | ||
) | const |
Definition at line 3179 of file TraCIAPI.cpp.
References CMD_SET_PERSON_VARIABLE, TYPE_DOUBLE, VAR_LENGTH, tcpip::Storage::writeDouble(), and tcpip::Storage::writeUnsignedByte().
Referenced by TraCITestClient::testAPI().
void TraCIAPI::PersonScope::setMinGap | ( | const std::string & | personID, |
double | minGap | ||
) | const |
Definition at line 3210 of file TraCIAPI.cpp.
References CMD_SET_PERSON_VARIABLE, TYPE_DOUBLE, VAR_MINGAP, tcpip::Storage::writeDouble(), and tcpip::Storage::writeUnsignedByte().
Referenced by TraCITestClient::testAPI().
|
inherited |
set generic paramter
Definition at line 3244 of file TraCIAPI.cpp.
References TYPE_COMPOUND, TYPE_STRING, VAR_PARAMETER, tcpip::Storage::writeInt(), tcpip::Storage::writeString(), and tcpip::Storage::writeUnsignedByte().
Referenced by TraCITestClient::testAPI(), and TraCIAPI::TraCIScopeWrapper::~TraCIScopeWrapper().
void TraCIAPI::PersonScope::setSpeed | ( | const std::string & | personID, |
double | speed | ||
) | const |
Definition at line 3158 of file TraCIAPI.cpp.
References CMD_SET_PERSON_VARIABLE, TYPE_DOUBLE, VAR_SPEED, tcpip::Storage::writeDouble(), and tcpip::Storage::writeUnsignedByte().
Referenced by TraCITestClient::testAPI().
void TraCIAPI::PersonScope::setType | ( | const std::string & | personID, |
const std::string & | typeID | ||
) | const |
Definition at line 3169 of file TraCIAPI.cpp.
References CMD_SET_PERSON_VARIABLE, TYPE_STRING, VAR_TYPE, tcpip::Storage::writeString(), and tcpip::Storage::writeUnsignedByte().
Referenced by TraCITestClient::testAPI().
void TraCIAPI::PersonScope::setWidth | ( | const std::string & | personID, |
double | width | ||
) | const |
Definition at line 3190 of file TraCIAPI.cpp.
References CMD_SET_PERSON_VARIABLE, TYPE_DOUBLE, VAR_WIDTH, tcpip::Storage::writeDouble(), and tcpip::Storage::writeUnsignedByte().
Referenced by TraCITestClient::testAPI().
|
inherited |
Definition at line 3259 of file TraCIAPI.cpp.
Referenced by TraCITestClient::testAPI(), and TraCIAPI::TraCIScopeWrapper::~TraCIScopeWrapper().
|
inherited |
Definition at line 3271 of file TraCIAPI.cpp.
Referenced by TraCITestClient::testAPI(), and TraCIAPI::TraCIScopeWrapper::~TraCIScopeWrapper().
|
protectedinherited |
Definition at line 146 of file TraCIAPI.h.
|
protectedinherited |
Definition at line 147 of file TraCIAPI.h.
|
protectedinherited |
Definition at line 149 of file TraCIAPI.h.
|
protectedinherited |
Definition at line 151 of file TraCIAPI.h.
|
protectedinherited |
The parent TraCI client which offers the connection.
Definition at line 145 of file TraCIAPI.h.
|
protectedinherited |
Definition at line 148 of file TraCIAPI.h.
|
protectedinherited |
Definition at line 150 of file TraCIAPI.h.