![]() |
Eclipse 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=libsumo::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 | appendStage (const std::string &personID, const libsumo::TraCIStage &stage) |
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 | getSlope (const std::string &personID) const |
double | getSpeed (const std::string &personID) const |
libsumo::TraCIStage | 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 875 of file TraCIAPI.h.
|
inlinevirtual |
Definition at line 876 of file TraCIAPI.h.
References libsumo::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 = libsumo::DEPARTFLAG_NOW , |
||
const std::string | typeID = "DEFAULT_PEDTYPE" |
||
) |
Definition at line 3402 of file TraCIAPI.cpp.
References libsumo::ADD, libsumo::CMD_SET_PERSON_VARIABLE, libsumo::TYPE_COMPOUND, libsumo::TYPE_DOUBLE, libsumo::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 3493 of file TraCIAPI.cpp.
References libsumo::APPEND_STAGE, libsumo::CMD_SET_PERSON_VARIABLE, libsumo::STAGE_DRIVING, libsumo::TYPE_COMPOUND, libsumo::TYPE_INTEGER, libsumo::TYPE_STRING, tcpip::Storage::writeInt(), tcpip::Storage::writeString(), and tcpip::Storage::writeUnsignedByte().
Referenced by TraCITestClient::testAPI().
void TraCIAPI::PersonScope::appendStage | ( | const std::string & | personID, |
const libsumo::TraCIStage & | stage | ||
) |
Definition at line 3419 of file TraCIAPI.cpp.
References libsumo::APPEND_STAGE, libsumo::TraCIStage::arrivalPos, libsumo::CMD_SET_PERSON_VARIABLE, 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, libsumo::TYPE_DOUBLE, libsumo::TYPE_INTEGER, libsumo::TYPE_STRING, libsumo::TYPE_STRINGLIST, libsumo::TraCIStage::vType, tcpip::Storage::writeDouble(), tcpip::Storage::writeInt(), tcpip::Storage::writeString(), tcpip::Storage::writeStringList(), 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 3455 of file TraCIAPI.cpp.
References libsumo::APPEND_STAGE, libsumo::CMD_SET_PERSON_VARIABLE, libsumo::STAGE_WAITING, libsumo::TYPE_COMPOUND, libsumo::TYPE_DOUBLE, libsumo::TYPE_INTEGER, libsumo::TYPE_STRING, tcpip::Storage::writeDouble(), 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 3472 of file TraCIAPI.cpp.
References libsumo::APPEND_STAGE, libsumo::CMD_SET_PERSON_VARIABLE, libsumo::STAGE_WALKING, libsumo::TYPE_COMPOUND, libsumo::TYPE_DOUBLE, libsumo::TYPE_INTEGER, libsumo::TYPE_STRING, libsumo::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 3667 of file TraCIAPI.cpp.
Referenced by TraCIAPI::TraCIScopeWrapper::~TraCIScopeWrapper().
|
inherited |
Definition at line 3651 of file TraCIAPI.cpp.
Referenced by TraCIAPI::TraCIScopeWrapper::~TraCIScopeWrapper().
|
inherited |
Definition at line 3635 of file TraCIAPI.cpp.
Referenced by TraCIAPI::TraCIScopeWrapper::~TraCIScopeWrapper().
double TraCIAPI::PersonScope::getAngle | ( | const std::string & | personID | ) | const |
Definition at line 3310 of file TraCIAPI.cpp.
References libsumo::CMD_GET_PERSON_VARIABLE, and libsumo::VAR_ANGLE.
Referenced by TraCITestClient::testAPI().
libsumo::TraCIColor TraCIAPI::PersonScope::getColor | ( | const std::string & | personID | ) | const |
Definition at line 3325 of file TraCIAPI.cpp.
References libsumo::CMD_GET_PERSON_VARIABLE, and libsumo::VAR_COLOR.
Referenced by TraCITestClient::testAPI().
|
inherited |
Definition at line 3657 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 3374 of file TraCIAPI.cpp.
References libsumo::CMD_GET_PERSON_VARIABLE, libsumo::TYPE_INTEGER, libsumo::VAR_EDGES, tcpip::Storage::writeByte(), and tcpip::Storage::writeInt().
Referenced by TraCITestClient::testAPI().
int TraCIAPI::PersonScope::getIDCount | ( | ) | const |
Definition at line 3290 of file TraCIAPI.cpp.
References libsumo::CMD_GET_PERSON_VARIABLE, and libsumo::ID_COUNT.
std::vector< std::string > TraCIAPI::PersonScope::getIDList | ( | ) | const |
Definition at line 3285 of file TraCIAPI.cpp.
References libsumo::CMD_GET_PERSON_VARIABLE, and libsumo::TRACI_ID_LIST.
Referenced by TraCITestClient::testAPI().
double TraCIAPI::PersonScope::getLanePosition | ( | const std::string & | personID | ) | const |
Definition at line 3320 of file TraCIAPI.cpp.
References libsumo::CMD_GET_PERSON_VARIABLE, and libsumo::VAR_LANEPOSITION.
Referenced by TraCITestClient::testAPI().
double TraCIAPI::PersonScope::getLength | ( | const std::string & | personID | ) | const |
Definition at line 3330 of file TraCIAPI.cpp.
References libsumo::CMD_GET_PERSON_VARIABLE, and libsumo::VAR_LENGTH.
Referenced by TraCITestClient::testAPI().
|
inherited |
Definition at line 3680 of file TraCIAPI.cpp.
Referenced by TraCIAPI::TraCIScopeWrapper::~TraCIScopeWrapper().
|
inherited |
Definition at line 3674 of file TraCIAPI.cpp.
Referenced by TraCIAPI::TraCIScopeWrapper::~TraCIScopeWrapper().
std::string TraCIAPI::PersonScope::getNextEdge | ( | const std::string & | personID | ) | const |
Definition at line 3350 of file TraCIAPI.cpp.
References libsumo::CMD_GET_PERSON_VARIABLE, and libsumo::VAR_NEXT_EDGE.
Referenced by TraCITestClient::testAPI().
|
inherited |
retrieve generic paramter
Definition at line 3590 of file TraCIAPI.cpp.
References libsumo::TYPE_STRING, libsumo::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 3300 of file TraCIAPI.cpp.
References libsumo::CMD_GET_PERSON_VARIABLE, and libsumo::VAR_POSITION.
Referenced by TraCITestClient::testAPI().
libsumo::TraCIPosition TraCIAPI::PersonScope::getPosition3D | ( | const std::string & | personID | ) | const |
Definition at line 3305 of file TraCIAPI.cpp.
References libsumo::CMD_GET_PERSON_VARIABLE, and libsumo::VAR_POSITION3D.
Referenced by TraCITestClient::testAPI().
int TraCIAPI::PersonScope::getRemainingStages | ( | const std::string & | personID | ) | const |
Definition at line 3361 of file TraCIAPI.cpp.
References libsumo::CMD_GET_PERSON_VARIABLE, and libsumo::VAR_STAGES_REMAINING.
Referenced by TraCITestClient::testAPI().
std::string TraCIAPI::PersonScope::getRoadID | ( | const std::string & | personID | ) | const |
Definition at line 3335 of file TraCIAPI.cpp.
References libsumo::CMD_GET_PERSON_VARIABLE, and libsumo::VAR_ROAD_ID.
Referenced by TraCITestClient::testAPI().
double TraCIAPI::PersonScope::getSlope | ( | const std::string & | personID | ) | const |
Definition at line 3315 of file TraCIAPI.cpp.
References libsumo::CMD_GET_PERSON_VARIABLE, and libsumo::VAR_SLOPE.
Referenced by TraCITestClient::testAPI().
double TraCIAPI::PersonScope::getSpeed | ( | const std::string & | personID | ) | const |
Definition at line 3295 of file TraCIAPI.cpp.
References libsumo::CMD_GET_PERSON_VARIABLE, and libsumo::VAR_SPEED.
Referenced by TraCITestClient::testAPI().
libsumo::TraCIStage TraCIAPI::PersonScope::getStage | ( | const std::string & | personID, |
int | nextStageIndex = 0 |
||
) | const |
Definition at line 3366 of file TraCIAPI.cpp.
References libsumo::CMD_GET_PERSON_VARIABLE, libsumo::TYPE_INTEGER, libsumo::VAR_STAGE, tcpip::Storage::writeByte(), and tcpip::Storage::writeInt().
Referenced by TraCITestClient::testAPI().
|
inherited |
Definition at line 3641 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 3340 of file TraCIAPI.cpp.
References libsumo::CMD_GET_PERSON_VARIABLE, and libsumo::VAR_TYPE.
Referenced by TraCITestClient::testAPI().
std::string TraCIAPI::PersonScope::getVehicle | ( | const std::string & | personID | ) | const |
Definition at line 3356 of file TraCIAPI.cpp.
References libsumo::CMD_GET_PERSON_VARIABLE, and libsumo::VAR_VEHICLE.
Referenced by TraCITestClient::testAPI().
double TraCIAPI::PersonScope::getWaitingTime | ( | const std::string & | personID | ) | const |
Definition at line 3345 of file TraCIAPI.cpp.
References libsumo::CMD_GET_PERSON_VARIABLE, and libsumo::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 3510 of file TraCIAPI.cpp.
References libsumo::CMD_SET_PERSON_VARIABLE, libsumo::REMOVE_STAGE, libsumo::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 3382 of file TraCIAPI.cpp.
Referenced by TraCITestClient::testAPI().
void TraCIAPI::PersonScope::rerouteTraveltime | ( | const std::string & | personID | ) | const |
Definition at line 3392 of file TraCIAPI.cpp.
References libsumo::CMD_REROUTE_TRAVELTIME, libsumo::CMD_SET_PERSON_VARIABLE, libsumo::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 3577 of file TraCIAPI.cpp.
References libsumo::TraCIColor::a, libsumo::TraCIColor::b, libsumo::CMD_SET_PERSON_VARIABLE, libsumo::TraCIColor::g, libsumo::TraCIColor::r, libsumo::TYPE_COLOR, libsumo::VAR_COLOR, and tcpip::Storage::writeUnsignedByte().
Referenced by TraCITestClient::testAPI().
void TraCIAPI::PersonScope::setHeight | ( | const std::string & | personID, |
double | height | ||
) | const |
Definition at line 3558 of file TraCIAPI.cpp.
References libsumo::CMD_SET_PERSON_VARIABLE, libsumo::TYPE_DOUBLE, libsumo::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 3539 of file TraCIAPI.cpp.
References libsumo::CMD_SET_PERSON_VARIABLE, libsumo::TYPE_DOUBLE, libsumo::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 3567 of file TraCIAPI.cpp.
References libsumo::CMD_SET_PERSON_VARIABLE, libsumo::TYPE_DOUBLE, libsumo::VAR_MINGAP, tcpip::Storage::writeDouble(), and tcpip::Storage::writeUnsignedByte().
Referenced by TraCITestClient::testAPI().
|
inherited |
set generic paramter
Definition at line 3599 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(), and TraCIAPI::TraCIScopeWrapper::~TraCIScopeWrapper().
void TraCIAPI::PersonScope::setSpeed | ( | const std::string & | personID, |
double | speed | ||
) | const |
Definition at line 3520 of file TraCIAPI.cpp.
References libsumo::CMD_SET_PERSON_VARIABLE, libsumo::TYPE_DOUBLE, libsumo::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 3530 of file TraCIAPI.cpp.
References libsumo::CMD_SET_PERSON_VARIABLE, libsumo::TYPE_STRING, libsumo::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 3549 of file TraCIAPI.cpp.
References libsumo::CMD_SET_PERSON_VARIABLE, libsumo::TYPE_DOUBLE, libsumo::VAR_WIDTH, tcpip::Storage::writeDouble(), and tcpip::Storage::writeUnsignedByte().
Referenced by TraCITestClient::testAPI().
|
inherited |
Definition at line 3613 of file TraCIAPI.cpp.
Referenced by TraCITestClient::testAPI(), and TraCIAPI::TraCIScopeWrapper::~TraCIScopeWrapper().
|
inherited |
Definition at line 3625 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.