![]() |
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="") |
std::vector< std::string > | getEdges (const std::string &personID, int nextStageIndex=0) const |
int | getIDCount () const |
std::vector< std::string > | getIDList () const |
std::string | getNextEdge (const std::string &personID) const |
TraCIPosition | getPosition (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 |
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 | setColor (const std::string &personID, const 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 | 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 |
virtual | ~PersonScope () |
Protected Attributes | |
TraCIAPI & | myParent |
The parent TraCI client which offers the connection. More... | |
Private Member Functions | |
PersonScope & | operator= (const PersonScope &src) |
invalidated assignment operator More... | |
PersonScope (const PersonScope &src) | |
invalidated copy constructor More... | |
|
inline |
Definition at line 726 of file TraCIAPI.h.
|
inlinevirtual |
Definition at line 727 of file TraCIAPI.h.
References DEPARTFLAG_NOW, TraCIAPI::getPosition(), 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 2417 of file TraCIAPI.cpp.
References ADD, CMD_SET_PERSON_VARIABLE, TYPE_COMPOUND, TYPE_DOUBLE, TYPE_INTEGER, 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 2482 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 2438 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 2457 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().
std::vector< std::string > TraCIAPI::PersonScope::getEdges | ( | const std::string & | personID, |
int | nextStageIndex = 0 |
||
) | const |
Definition at line 2400 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 2346 of file TraCIAPI.cpp.
References CMD_GET_PERSON_VARIABLE, and ID_COUNT.
std::vector< std::string > TraCIAPI::PersonScope::getIDList | ( | ) | const |
Definition at line 2341 of file TraCIAPI.cpp.
References CMD_GET_PERSON_VARIABLE, and ID_LIST.
Referenced by TraCITestClient::testAPI().
std::string TraCIAPI::PersonScope::getNextEdge | ( | const std::string & | personID | ) | const |
Definition at line 2376 of file TraCIAPI.cpp.
References CMD_GET_PERSON_VARIABLE, and VAR_NEXT_EDGE.
Referenced by TraCITestClient::testAPI().
TraCIPosition TraCIAPI::PersonScope::getPosition | ( | const std::string & | personID | ) | const |
Definition at line 2356 of file TraCIAPI.cpp.
References CMD_GET_PERSON_VARIABLE, and VAR_POSITION.
int TraCIAPI::PersonScope::getRemainingStages | ( | const std::string & | personID | ) | const |
Definition at line 2387 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 2361 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 2351 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 2392 of file TraCIAPI.cpp.
References CMD_GET_PERSON_VARIABLE, TYPE_INTEGER, VAR_STAGE, tcpip::Storage::writeByte(), and tcpip::Storage::writeInt().
Referenced by TraCITestClient::testAPI().
std::string TraCIAPI::PersonScope::getTypeID | ( | const std::string & | personID | ) | const |
Definition at line 2366 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 2382 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 2371 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 2500 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 2408 of file TraCIAPI.cpp.
Referenced by TraCITestClient::testAPI().
void TraCIAPI::PersonScope::setColor | ( | const std::string & | personID, |
const TraCIColor & | c | ||
) | const |
Definition at line 2574 of file TraCIAPI.cpp.
References TraCIColor::a, TraCIColor::b, CMD_SET_PERSON_VARIABLE, TraCIColor::g, 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 2553 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 2532 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 2563 of file TraCIAPI.cpp.
References CMD_SET_PERSON_VARIABLE, TYPE_DOUBLE, VAR_MINGAP, tcpip::Storage::writeDouble(), and tcpip::Storage::writeUnsignedByte().
Referenced by TraCITestClient::testAPI().
void TraCIAPI::PersonScope::setSpeed | ( | const std::string & | personID, |
double | speed | ||
) | const |
Definition at line 2511 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 2522 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 2543 of file TraCIAPI.cpp.
References CMD_SET_PERSON_VARIABLE, TYPE_DOUBLE, VAR_WIDTH, tcpip::Storage::writeDouble(), and tcpip::Storage::writeUnsignedByte().
Referenced by TraCITestClient::testAPI().
|
protectedinherited |
The parent TraCI client which offers the connection.
Definition at line 131 of file TraCIAPI.h.