![]() |
Eclipse SUMO - Simulation of Urban MObility
|
Scope for interaction with the simulation. More...
#include <TraCIAPI.h>
Public Member Functions | |
void | clearSubscriptionResults () |
libsumo::TraCIPosition | convert2D (const std::string &edgeID, double pos, int laneIndex=0, bool toGeo=false) const |
libsumo::TraCIPosition | convert3D (const std::string &edgeID, double pos, int laneIndex=0, bool toGeo=false) const |
libsumo::TraCIPosition | convertGeo (double x, double y, bool fromGeo=false) const |
libsumo::TraCIRoadPosition | convertRoad (double x, double y, bool isGeo=false, const std::string &vClass="ignoring") const |
libsumo::TraCIStage | findRoute (const std::string &fromEdge, const std::string &toEdge, const std::string &vType="", double pos=-1., int routingMode=0) const |
const libsumo::ContextSubscriptionResults | getAllContextSubscriptionResults () const |
const libsumo::SubscriptionResults | getAllSubscriptionResults () const |
std::vector< std::string > | getArrivedIDList () const |
int | getArrivedNumber () const |
int | getBusStopWaiting (const std::string &stopID) const |
std::vector< std::string > | getBusStopWaitingIDList (const std::string &stopID) const |
const libsumo::SubscriptionResults | getContextSubscriptionResults (const std::string &objID) const |
int | getCurrentTime () const |
double | getDeltaT () const |
std::vector< std::string > | getDepartedIDList () const |
int | getDepartedNumber () const |
double | getDistance2D (double x1, double y1, double x2, double y2, bool isGeo=false, bool isDriving=false) |
double | getDistanceRoad (const std::string &edgeID1, double pos1, const std::string &edgeID2, double pos2, bool isDriving=false) |
std::vector< std::string > | getEndingTeleportIDList () const |
int | getEndingTeleportNumber () const |
int | getIDCount () const |
std::vector< std::string > | getIDList () const |
std::vector< std::string > | getLoadedIDList () const |
int | getLoadedNumber () const |
int | getMinExpectedNumber () const |
libsumo::SubscriptionResults & | getModifiableContextSubscriptionResults (const std::string &objID) |
libsumo::SubscriptionResults & | getModifiableSubscriptionResults () |
libsumo::TraCIPositionVector | getNetBoundary () 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... | |
std::vector< std::string > | getStartingTeleportIDList () const |
int | getStartingTeleportNumber () const |
const libsumo::TraCIResults | getSubscriptionResults (const std::string &objID) const |
double | getTime () const |
void | setParameter (const std::string &objectID, const std::string &key, const std::string &value) const |
set generic paramter More... | |
SimulationScope (TraCIAPI &parent) | |
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 |
void | writeMessage (const std::string msg) |
virtual | ~SimulationScope () |
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 |
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 the simulation.
Definition at line 407 of file TraCIAPI.h.
|
inline |
Definition at line 409 of file TraCIAPI.h.
|
inlinevirtual |
Definition at line 410 of file TraCIAPI.h.
|
inherited |
Definition at line 3759 of file TraCIAPI.cpp.
libsumo::TraCIPosition TraCIAPI::SimulationScope::convert2D | ( | const std::string & | edgeID, |
double | pos, | ||
int | laneIndex = 0 , |
||
bool | toGeo = false |
||
) | const |
Definition at line 1418 of file TraCIAPI.cpp.
References libsumo::CMD_GET_SIM_VARIABLE, libsumo::POSITION_2D, libsumo::POSITION_CONVERSION, libsumo::POSITION_LON_LAT, libsumo::POSITION_ROADMAP, libsumo::TYPE_COMPOUND, libsumo::TYPE_UBYTE, tcpip::Storage::writeByte(), tcpip::Storage::writeDouble(), tcpip::Storage::writeInt(), tcpip::Storage::writeString(), libsumo::TraCIPosition::x, and libsumo::TraCIPosition::y.
Referenced by TraCITestClient::testAPI().
libsumo::TraCIPosition TraCIAPI::SimulationScope::convert3D | ( | const std::string & | edgeID, |
double | pos, | ||
int | laneIndex = 0 , |
||
bool | toGeo = false |
||
) | const |
Definition at line 1440 of file TraCIAPI.cpp.
References libsumo::CMD_GET_SIM_VARIABLE, libsumo::POSITION_3D, libsumo::POSITION_CONVERSION, libsumo::POSITION_LON_LAT_ALT, libsumo::POSITION_ROADMAP, libsumo::TYPE_COMPOUND, libsumo::TYPE_UBYTE, tcpip::Storage::writeByte(), tcpip::Storage::writeDouble(), tcpip::Storage::writeInt(), tcpip::Storage::writeString(), libsumo::TraCIPosition::x, libsumo::TraCIPosition::y, and libsumo::TraCIPosition::z.
Referenced by TraCITestClient::testAPI().
libsumo::TraCIPosition TraCIAPI::SimulationScope::convertGeo | ( | double | x, |
double | y, | ||
bool | fromGeo = false |
||
) | const |
Definition at line 1486 of file TraCIAPI.cpp.
References libsumo::CMD_GET_SIM_VARIABLE, libsumo::POSITION_2D, libsumo::POSITION_CONVERSION, libsumo::POSITION_LON_LAT, libsumo::TYPE_COMPOUND, libsumo::TYPE_UBYTE, tcpip::Storage::writeByte(), tcpip::Storage::writeDouble(), tcpip::Storage::writeInt(), libsumo::TraCIPosition::x, and libsumo::TraCIPosition::y.
Referenced by TraCITestClient::testAPI().
libsumo::TraCIRoadPosition TraCIAPI::SimulationScope::convertRoad | ( | double | x, |
double | y, | ||
bool | isGeo = false , |
||
const std::string & | vClass = "ignoring" |
||
) | const |
Definition at line 1463 of file TraCIAPI.cpp.
References libsumo::CMD_GET_SIM_VARIABLE, libsumo::TraCIRoadPosition::edgeID, libsumo::TraCIRoadPosition::laneIndex, libsumo::TraCIRoadPosition::pos, libsumo::POSITION_2D, libsumo::POSITION_CONVERSION, libsumo::POSITION_LON_LAT, libsumo::POSITION_ROADMAP, libsumo::TYPE_COMPOUND, libsumo::TYPE_STRING, libsumo::TYPE_UBYTE, tcpip::Storage::writeByte(), tcpip::Storage::writeDouble(), tcpip::Storage::writeInt(), and tcpip::Storage::writeString().
Referenced by TraCITestClient::testAPI().
libsumo::TraCIStage TraCIAPI::SimulationScope::findRoute | ( | const std::string & | fromEdge, |
const std::string & | toEdge, | ||
const std::string & | vType = "" , |
||
double | pos = -1. , |
||
int | routingMode = 0 |
||
) | const |
Definition at line 1549 of file TraCIAPI.cpp.
References libsumo::FIND_ROUTE, libsumo::TYPE_COMPOUND, libsumo::TYPE_DOUBLE, libsumo::TYPE_INTEGER, libsumo::TYPE_STRING, tcpip::Storage::writeByte(), tcpip::Storage::writeDouble(), tcpip::Storage::writeInt(), tcpip::Storage::writeString(), and tcpip::Storage::writeUnsignedByte().
Referenced by TraCITestClient::testAPI().
|
inherited |
Definition at line 3743 of file TraCIAPI.cpp.
|
inherited |
Definition at line 3727 of file TraCIAPI.cpp.
std::vector< std::string > TraCIAPI::SimulationScope::getArrivedIDList | ( | ) | const |
Definition at line 1366 of file TraCIAPI.cpp.
References libsumo::VAR_ARRIVED_VEHICLES_IDS.
int TraCIAPI::SimulationScope::getArrivedNumber | ( | ) | const |
Definition at line 1361 of file TraCIAPI.cpp.
References libsumo::VAR_ARRIVED_VEHICLES_NUMBER.
int TraCIAPI::SimulationScope::getBusStopWaiting | ( | const std::string & | stopID | ) | const |
Definition at line 1407 of file TraCIAPI.cpp.
References libsumo::VAR_BUS_STOP_WAITING.
Referenced by TraCITestClient::testAPI().
std::vector< std::string > TraCIAPI::SimulationScope::getBusStopWaitingIDList | ( | const std::string & | stopID | ) | const |
Definition at line 1412 of file TraCIAPI.cpp.
References libsumo::VAR_BUS_STOP_WAITING_IDS.
Referenced by TraCITestClient::testAPI().
|
protectedinherited |
Definition at line 3443 of file TraCIAPI.cpp.
References libsumo::INVALID_INT_VALUE, and libsumo::TYPE_BYTE.
|
protectedinherited |
Definition at line 3545 of file TraCIAPI.cpp.
References libsumo::TraCIColor::a, libsumo::TraCIColor::b, libsumo::TraCIColor::g, libsumo::TraCIColor::r, and libsumo::TYPE_COLOR.
|
inherited |
Definition at line 3749 of file TraCIAPI.cpp.
Referenced by TraCITestClient::testAPI().
int TraCIAPI::SimulationScope::getCurrentTime | ( | ) | const |
Definition at line 1331 of file TraCIAPI.cpp.
References libsumo::VAR_TIME_STEP.
Referenced by TraCITestClient::testAPI().
double TraCIAPI::SimulationScope::getDeltaT | ( | ) | const |
Definition at line 1391 of file TraCIAPI.cpp.
References libsumo::VAR_DELTA_T.
Referenced by TraCITestClient::testAPI().
std::vector< std::string > TraCIAPI::SimulationScope::getDepartedIDList | ( | ) | const |
Definition at line 1356 of file TraCIAPI.cpp.
References libsumo::VAR_DEPARTED_VEHICLES_IDS.
int TraCIAPI::SimulationScope::getDepartedNumber | ( | ) | const |
Definition at line 1351 of file TraCIAPI.cpp.
References libsumo::VAR_DEPARTED_VEHICLES_NUMBER.
double TraCIAPI::SimulationScope::getDistance2D | ( | double | x1, |
double | y1, | ||
double | x2, | ||
double | y2, | ||
bool | isGeo = false , |
||
bool | isDriving = false |
||
) |
Definition at line 1507 of file TraCIAPI.cpp.
References libsumo::CMD_GET_SIM_VARIABLE, libsumo::DISTANCE_REQUEST, libsumo::POSITION_2D, libsumo::POSITION_LON_LAT, libsumo::REQUEST_AIRDIST, libsumo::REQUEST_DRIVINGDIST, libsumo::TYPE_COMPOUND, libsumo::TYPE_DOUBLE, tcpip::Storage::writeByte(), tcpip::Storage::writeDouble(), and tcpip::Storage::writeInt().
Referenced by TraCITestClient::testAPI().
double TraCIAPI::SimulationScope::getDistanceRoad | ( | const std::string & | edgeID1, |
double | pos1, | ||
const std::string & | edgeID2, | ||
double | pos2, | ||
bool | isDriving = false |
||
) |
Definition at line 1527 of file TraCIAPI.cpp.
References libsumo::CMD_GET_SIM_VARIABLE, libsumo::DISTANCE_REQUEST, libsumo::POSITION_ROADMAP, libsumo::REQUEST_AIRDIST, libsumo::REQUEST_DRIVINGDIST, libsumo::TYPE_COMPOUND, libsumo::TYPE_DOUBLE, tcpip::Storage::writeByte(), tcpip::Storage::writeDouble(), tcpip::Storage::writeInt(), and tcpip::Storage::writeString().
Referenced by TraCITestClient::testAPI().
|
protectedinherited |
Definition at line 3464 of file TraCIAPI.cpp.
References libsumo::INVALID_DOUBLE_VALUE, and libsumo::TYPE_DOUBLE.
Referenced by TraCIAPI::EdgeScope::getAdaptedTraveltime().
std::vector< std::string > TraCIAPI::SimulationScope::getEndingTeleportIDList | ( | ) | const |
Definition at line 1386 of file TraCIAPI.cpp.
References libsumo::VAR_TELEPORT_ENDING_VEHICLES_IDS.
int TraCIAPI::SimulationScope::getEndingTeleportNumber | ( | ) | const |
Definition at line 1381 of file TraCIAPI.cpp.
References libsumo::VAR_TELEPORT_ENDING_VEHICLES_NUMBER.
|
inherited |
Definition at line 3614 of file TraCIAPI.cpp.
References libsumo::ID_COUNT.
Referenced by TraCITestClient::testAPI().
|
inherited |
Definition at line 3608 of file TraCIAPI.cpp.
References libsumo::TRACI_ID_LIST.
Referenced by TraCITestClient::testAPI().
|
protectedinherited |
Definition at line 3454 of file TraCIAPI.cpp.
References libsumo::INVALID_INT_VALUE, and libsumo::TYPE_INTEGER.
std::vector< std::string > TraCIAPI::SimulationScope::getLoadedIDList | ( | ) | const |
Definition at line 1346 of file TraCIAPI.cpp.
References libsumo::VAR_LOADED_VEHICLES_IDS.
int TraCIAPI::SimulationScope::getLoadedNumber | ( | ) | const |
Definition at line 1341 of file TraCIAPI.cpp.
References libsumo::VAR_LOADED_VEHICLES_NUMBER.
int TraCIAPI::SimulationScope::getMinExpectedNumber | ( | ) | const |
Definition at line 1402 of file TraCIAPI.cpp.
References libsumo::VAR_MIN_EXPECTED_VEHICLES.
|
inherited |
Definition at line 3772 of file TraCIAPI.cpp.
|
inherited |
Definition at line 3766 of file TraCIAPI.cpp.
libsumo::TraCIPositionVector TraCIAPI::SimulationScope::getNetBoundary | ( | ) | const |
Definition at line 1396 of file TraCIAPI.cpp.
References libsumo::VAR_NET_BOUNDING_BOX.
|
inherited |
retrieve generic parameter
Definition at line 3620 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 3629 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().
|
protectedinherited |
Definition at line 3474 of file TraCIAPI.cpp.
References libsumo::TYPE_POLYGON, libsumo::TraCIPosition::x, libsumo::TraCIPosition::y, and libsumo::TraCIPosition::z.
|
protectedinherited |
Definition at line 3495 of file TraCIAPI.cpp.
References libsumo::POSITION_2D, libsumo::TraCIPosition::x, libsumo::TraCIPosition::y, and libsumo::TraCIPosition::z.
|
protectedinherited |
Definition at line 3508 of file TraCIAPI.cpp.
References libsumo::POSITION_3D, libsumo::TraCIPosition::x, libsumo::TraCIPosition::y, and libsumo::TraCIPosition::z.
std::vector< std::string > TraCIAPI::SimulationScope::getStartingTeleportIDList | ( | ) | const |
Definition at line 1376 of file TraCIAPI.cpp.
References libsumo::VAR_TELEPORT_STARTING_VEHICLES_IDS.
int TraCIAPI::SimulationScope::getStartingTeleportNumber | ( | ) | const |
Definition at line 1371 of file TraCIAPI.cpp.
References libsumo::VAR_TELEPORT_STARTING_VEHICLES_NUMBER.
|
protectedinherited |
Definition at line 3521 of file TraCIAPI.cpp.
References libsumo::TYPE_STRING.
|
protectedinherited |
Definition at line 3531 of file TraCIAPI.cpp.
References libsumo::TYPE_STRINGLIST.
|
inherited |
Definition at line 3733 of file TraCIAPI.cpp.
Referenced by TraCITestClient::testAPI().
double TraCIAPI::SimulationScope::getTime | ( | ) | const |
Definition at line 1336 of file TraCIAPI.cpp.
References libsumo::VAR_TIME.
|
protectedinherited |
Definition at line 3559 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 3433 of file TraCIAPI.cpp.
References libsumo::INVALID_INT_VALUE, and libsumo::TYPE_UBYTE.
|
protectedinherited |
Definition at line 3672 of file TraCIAPI.cpp.
References libsumo::TYPE_DOUBLE, tcpip::Storage::writeDouble(), and tcpip::Storage::writeUnsignedByte().
|
protectedinherited |
Definition at line 3662 of file TraCIAPI.cpp.
References libsumo::TYPE_INTEGER, tcpip::Storage::writeInt(), and tcpip::Storage::writeUnsignedByte().
|
inherited |
set generic paramter
Definition at line 3648 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().
|
protectedinherited |
Definition at line 3682 of file TraCIAPI.cpp.
References libsumo::TYPE_STRING, tcpip::Storage::writeString(), and tcpip::Storage::writeUnsignedByte().
|
protectedinherited |
Definition at line 3692 of file TraCIAPI.cpp.
References libsumo::TYPE_STRINGLIST, tcpip::Storage::writeInt(), tcpip::Storage::writeString(), and tcpip::Storage::writeUnsignedByte().
|
inherited |
Definition at line 3705 of file TraCIAPI.cpp.
Referenced by TraCITestClient::testAPI().
|
inherited |
Definition at line 3717 of file TraCIAPI.cpp.
Referenced by TraCITestClient::testAPI().
void TraCIAPI::SimulationScope::writeMessage | ( | const std::string | msg | ) |
Definition at line 1568 of file TraCIAPI.cpp.
References libsumo::CMD_MESSAGE, libsumo::CMD_SET_SIM_VARIABLE, libsumo::TYPE_STRING, tcpip::Storage::writeString(), and tcpip::Storage::writeUnsignedByte().
Referenced by TraCITestClient::testAPI().
|
privateinherited |
Definition at line 152 of file TraCIAPI.h.
|
privateinherited |
Definition at line 153 of file TraCIAPI.h.
|
privateinherited |
Definition at line 155 of file TraCIAPI.h.
|
privateinherited |
Definition at line 157 of file TraCIAPI.h.
|
protectedinherited |
The parent TraCI client which offers the connection.
Definition at line 149 of file TraCIAPI.h.
|
privateinherited |
Definition at line 154 of file TraCIAPI.h.
|
privateinherited |
Definition at line 156 of file TraCIAPI.h.