![]() |
SUMO - Simulation of Urban MObility
|
Scope for interaction with vehicles. More...
#include <TraCIAPI.h>
Data Structures | |
struct | NextTLSData |
Public Member Functions | |
void | add (const std::string &vehicleID, const std::string &routeID, const std::string &typeID="DEFAULT_VEHTYPE", std::string depart="-1", const std::string &departLane="first", const std::string &departPos="base", const std::string &departSpeed="0", const std::string &arrivalLane="current", const std::string &arrivalPos="max", const std::string &arrivalSpeed="current", const std::string &fromTaz="", const std::string &toTaz="", const std::string &line="", int personCapacity=0, int personNumber=0) const |
SUMOReal | getAngle (const std::string &vehicleID) const |
SUMOReal | getCO2Emission (const std::string &vehicleID) const |
SUMOReal | getCOEmission (const std::string &vehicleID) const |
TraCIColor | getColor (const std::string &vehicleID) const |
std::vector< std::string > | getEdges (const std::string &vehicleID) const |
SUMOReal | getElectricityConsumption (const std::string &vehicleID) const |
SUMOReal | getFuelConsumption (const std::string &vehicleID) const |
SUMOReal | getHCEmission (const std::string &vehicleID) const |
int | getIDCount () const |
std::vector< std::string > | getIDList () const |
std::string | getLaneID (const std::string &vehicleID) const |
int | getLaneIndex (const std::string &vehicleID) const |
SUMOReal | getLanePosition (const std::string &vehicleID) const |
std::vector< NextTLSData > | getNextTLS (const std::string &vehID) const |
SUMOReal | getNoiseEmission (const std::string &vehicleID) const |
SUMOReal | getNOxEmission (const std::string &vehicleID) const |
SUMOReal | getPMxEmission (const std::string &vehicleID) const |
TraCIPosition | getPosition (const std::string &vehicleID) const |
std::string | getRoadID (const std::string &vehicleID) const |
std::string | getRouteID (const std::string &vehicleID) const |
int | getRouteIndex (const std::string &vehicleID) const |
int | getSignalStates (const std::string &vehicleID) const |
SUMOReal | getSlope (const std::string &vehicleID) const |
SUMOReal | getSpeed (const std::string &vehicleID) const |
int | getSpeedMode (const std::string &vehicleID) const |
std::string | getTypeID (const std::string &vehicleID) const |
SUMOReal | getWaitingTime (const std::string &vehicleID) const |
void | moveTo (const std::string &vehicleID, const std::string &laneID, SUMOReal position) const |
void | moveToXY (const std::string &vehicleID, const std::string &edgeID, const int lane, const SUMOReal x, const SUMOReal y, const SUMOReal angle, const int keepRoute) const |
void | remove (const std::string &vehicleID, char reason=REMOVE_VAPORIZED) const |
void | setSpeed (const std::string &vehicleID, SUMOReal speed) const |
void | slowDown (const std::string &vehicleID, SUMOReal speed, int duration) const |
VehicleScope (TraCIAPI &parent) | |
virtual | ~VehicleScope () |
Protected Attributes | |
TraCIAPI & | myParent |
The parent TraCI client which offers the connection. More... | |
Private Member Functions | |
VehicleScope & | operator= (const VehicleScope &src) |
invalidated assignment operator More... | |
VehicleScope (const VehicleScope &src) | |
invalidated copy constructor More... | |
Scope for interaction with vehicles.
Definition at line 699 of file TraCIAPI.h.
|
inline |
Definition at line 701 of file TraCIAPI.h.
|
inlinevirtual |
Definition at line 702 of file TraCIAPI.h.
|
private |
invalidated copy constructor
void TraCIAPI::VehicleScope::add | ( | const std::string & | vehicleID, |
const std::string & | routeID, | ||
const std::string & | typeID = "DEFAULT_VEHTYPE" , |
||
std::string | depart = "-1" , |
||
const std::string & | departLane = "first" , |
||
const std::string & | departPos = "base" , |
||
const std::string & | departSpeed = "0" , |
||
const std::string & | arrivalLane = "current" , |
||
const std::string & | arrivalPos = "max" , |
||
const std::string & | arrivalSpeed = "current" , |
||
const std::string & | fromTaz = "" , |
||
const std::string & | toTaz = "" , |
||
const std::string & | line = "" , |
||
int | personCapacity = 0 , |
||
int | personNumber = 0 |
||
) | const |
Definition at line 1977 of file TraCIAPI.cpp.
References ADD_FULL, CMD_SET_VEHICLE_VARIABLE, TraCIAPI::toString(), TYPE_COMPOUND, TYPE_INTEGER, TYPE_STRING, tcpip::Storage::writeInt(), tcpip::Storage::writeString(), and tcpip::Storage::writeUnsignedByte().
Referenced by TraCITestClient::testAPI().
SUMOReal TraCIAPI::VehicleScope::getAngle | ( | const std::string & | vehicleID | ) | const |
Definition at line 1839 of file TraCIAPI.cpp.
References CMD_GET_VEHICLE_VARIABLE, and VAR_ANGLE.
SUMOReal TraCIAPI::VehicleScope::getCO2Emission | ( | const std::string & | vehicleID | ) | const |
Definition at line 1889 of file TraCIAPI.cpp.
References CMD_GET_VEHICLE_VARIABLE, SUMOReal, and VAR_CO2EMISSION.
SUMOReal TraCIAPI::VehicleScope::getCOEmission | ( | const std::string & | vehicleID | ) | const |
Definition at line 1894 of file TraCIAPI.cpp.
References CMD_GET_VEHICLE_VARIABLE, SUMOReal, and VAR_COEMISSION.
TraCIAPI::TraCIColor TraCIAPI::VehicleScope::getColor | ( | const std::string & | vehicleID | ) | const |
Definition at line 1879 of file TraCIAPI.cpp.
References CMD_GET_VEHICLE_VARIABLE, SUMOReal, and VAR_COLOR.
std::vector< std::string > TraCIAPI::VehicleScope::getEdges | ( | const std::string & | vehicleID | ) | const |
Definition at line 1874 of file TraCIAPI.cpp.
References CMD_GET_VEHICLE_VARIABLE, and VAR_EDGES.
SUMOReal TraCIAPI::VehicleScope::getElectricityConsumption | ( | const std::string & | vehicleID | ) | const |
Definition at line 1924 of file TraCIAPI.cpp.
References CMD_GET_VEHICLE_VARIABLE, SUMOReal, and VAR_ELECTRICITYCONSUMPTION.
SUMOReal TraCIAPI::VehicleScope::getFuelConsumption | ( | const std::string & | vehicleID | ) | const |
Definition at line 1914 of file TraCIAPI.cpp.
References CMD_GET_VEHICLE_VARIABLE, SUMOReal, and VAR_FUELCONSUMPTION.
SUMOReal TraCIAPI::VehicleScope::getHCEmission | ( | const std::string & | vehicleID | ) | const |
Definition at line 1899 of file TraCIAPI.cpp.
References CMD_GET_VEHICLE_VARIABLE, SUMOReal, and VAR_HCEMISSION.
int TraCIAPI::VehicleScope::getIDCount | ( | ) | const |
Definition at line 1824 of file TraCIAPI.cpp.
References CMD_GET_VEHICLE_VARIABLE, ID_COUNT, and SUMOReal.
Referenced by TraCITestClient::testAPI().
std::vector< std::string > TraCIAPI::VehicleScope::getIDList | ( | ) | const |
Definition at line 1819 of file TraCIAPI.cpp.
References CMD_GET_VEHICLE_VARIABLE, and ID_LIST.
Referenced by TraCITestClient::testAPI().
std::string TraCIAPI::VehicleScope::getLaneID | ( | const std::string & | vehicleID | ) | const |
Definition at line 1849 of file TraCIAPI.cpp.
References CMD_GET_VEHICLE_VARIABLE, and VAR_LANE_ID.
Referenced by TraCITestClient::testAPI().
int TraCIAPI::VehicleScope::getLaneIndex | ( | const std::string & | vehicleID | ) | const |
Definition at line 1854 of file TraCIAPI.cpp.
References CMD_GET_VEHICLE_VARIABLE, and VAR_LANE_INDEX.
SUMOReal TraCIAPI::VehicleScope::getLanePosition | ( | const std::string & | vehicleID | ) | const |
Definition at line 1884 of file TraCIAPI.cpp.
References CMD_GET_VEHICLE_VARIABLE, SUMOReal, and VAR_LANEPOSITION.
std::vector< TraCIAPI::VehicleScope::NextTLSData > TraCIAPI::VehicleScope::getNextTLS | ( | const std::string & | vehID | ) | const |
Definition at line 1947 of file TraCIAPI.cpp.
References CMD_GET_VEHICLE_VARIABLE, TraCIAPI::VehicleScope::NextTLSData::dist, TraCIAPI::VehicleScope::NextTLSData::id, tcpip::Storage::readByte(), tcpip::Storage::readDouble(), tcpip::Storage::readInt(), tcpip::Storage::readString(), tcpip::Storage::readUnsignedByte(), TraCIAPI::VehicleScope::NextTLSData::state, TraCIAPI::VehicleScope::NextTLSData::tlIndex, TYPE_COMPOUND, and VAR_NEXT_TLS.
Referenced by TraCITestClient::testAPI().
SUMOReal TraCIAPI::VehicleScope::getNoiseEmission | ( | const std::string & | vehicleID | ) | const |
Definition at line 1919 of file TraCIAPI.cpp.
References CMD_GET_VEHICLE_VARIABLE, SUMOReal, and VAR_NOISEEMISSION.
SUMOReal TraCIAPI::VehicleScope::getNOxEmission | ( | const std::string & | vehicleID | ) | const |
Definition at line 1909 of file TraCIAPI.cpp.
References CMD_GET_VEHICLE_VARIABLE, SUMOReal, and VAR_NOXEMISSION.
SUMOReal TraCIAPI::VehicleScope::getPMxEmission | ( | const std::string & | vehicleID | ) | const |
Definition at line 1904 of file TraCIAPI.cpp.
References CMD_GET_VEHICLE_VARIABLE, SUMOReal, and VAR_PMXEMISSION.
TraCIAPI::TraCIPosition TraCIAPI::VehicleScope::getPosition | ( | const std::string & | vehicleID | ) | const |
Definition at line 1834 of file TraCIAPI.cpp.
References CMD_GET_VEHICLE_VARIABLE, SUMOReal, and VAR_POSITION.
std::string TraCIAPI::VehicleScope::getRoadID | ( | const std::string & | vehicleID | ) | const |
Definition at line 1844 of file TraCIAPI.cpp.
References CMD_GET_VEHICLE_VARIABLE, and VAR_ROAD_ID.
Referenced by TraCITestClient::testAPI().
std::string TraCIAPI::VehicleScope::getRouteID | ( | const std::string & | vehicleID | ) | const |
Definition at line 1864 of file TraCIAPI.cpp.
References CMD_GET_VEHICLE_VARIABLE, and VAR_ROAD_ID.
int TraCIAPI::VehicleScope::getRouteIndex | ( | const std::string & | vehicleID | ) | const |
Definition at line 1869 of file TraCIAPI.cpp.
References CMD_GET_VEHICLE_VARIABLE, and VAR_ROUTE_INDEX.
int TraCIAPI::VehicleScope::getSignalStates | ( | const std::string & | vehicleID | ) | const |
SUMOReal TraCIAPI::VehicleScope::getSlope | ( | const std::string & | vehicleID | ) | const |
Definition at line 1941 of file TraCIAPI.cpp.
References CMD_GET_VEHICLE_VARIABLE, and VAR_SLOPE.
Referenced by TraCITestClient::testAPI().
SUMOReal TraCIAPI::VehicleScope::getSpeed | ( | const std::string & | vehicleID | ) | const |
Definition at line 1829 of file TraCIAPI.cpp.
References CMD_GET_VEHICLE_VARIABLE, and VAR_SPEED.
int TraCIAPI::VehicleScope::getSpeedMode | ( | const std::string & | vehicleID | ) | const |
Definition at line 1935 of file TraCIAPI.cpp.
References CMD_GET_VEHICLE_VARIABLE, SUMOReal, and VAR_SPEEDSETMODE.
Referenced by TraCITestClient::testAPI().
std::string TraCIAPI::VehicleScope::getTypeID | ( | const std::string & | vehicleID | ) | const |
Definition at line 1859 of file TraCIAPI.cpp.
References CMD_GET_VEHICLE_VARIABLE, and VAR_TYPE.
SUMOReal TraCIAPI::VehicleScope::getWaitingTime | ( | const std::string & | vehicleID | ) | const |
Definition at line 1929 of file TraCIAPI.cpp.
References CMD_GET_VEHICLE_VARIABLE, and VAR_WAITING_TIME.
Referenced by TraCITestClient::testAPI().
void TraCIAPI::VehicleScope::moveTo | ( | const std::string & | vehicleID, |
const std::string & | laneID, | ||
SUMOReal | position | ||
) | const |
Definition at line 2050 of file TraCIAPI.cpp.
References CMD_SET_VEHICLE_VARIABLE, TYPE_COMPOUND, TYPE_DOUBLE, TYPE_STRING, VAR_MOVE_TO, tcpip::Storage::writeDouble(), tcpip::Storage::writeInt(), tcpip::Storage::writeString(), and tcpip::Storage::writeUnsignedByte().
void TraCIAPI::VehicleScope::moveToXY | ( | const std::string & | vehicleID, |
const std::string & | edgeID, | ||
const int | lane, | ||
const SUMOReal | x, | ||
const SUMOReal | y, | ||
const SUMOReal | angle, | ||
const int | keepRoute | ||
) | const |
Definition at line 2064 of file TraCIAPI.cpp.
References CMD_SET_VEHICLE_VARIABLE.
Referenced by TraCITestClient::testAPI().
|
private |
invalidated assignment operator
void TraCIAPI::VehicleScope::remove | ( | const std::string & | vehicleID, |
char | reason = REMOVE_VAPORIZED |
||
) | const |
Definition at line 2038 of file TraCIAPI.cpp.
References CMD_SET_VEHICLE_VARIABLE, REMOVE, TYPE_BYTE, and tcpip::Storage::writeUnsignedByte().
Referenced by TraCITestClient::testAPI().
void TraCIAPI::VehicleScope::setSpeed | ( | const std::string & | vehicleID, |
SUMOReal | speed | ||
) | const |
Definition at line 2086 of file TraCIAPI.cpp.
References CMD_SET_VEHICLE_VARIABLE, TYPE_DOUBLE, VAR_SPEED, tcpip::Storage::writeDouble(), and tcpip::Storage::writeUnsignedByte().
void TraCIAPI::VehicleScope::slowDown | ( | const std::string & | vehicleID, |
SUMOReal | speed, | ||
int | duration | ||
) | const |
Definition at line 2072 of file TraCIAPI.cpp.
References CMD_SET_VEHICLE_VARIABLE, CMD_SLOWDOWN, TYPE_COMPOUND, TYPE_DOUBLE, TYPE_INTEGER, tcpip::Storage::writeDouble(), tcpip::Storage::writeInt(), and tcpip::Storage::writeUnsignedByte().
|
protectedinherited |
The parent TraCI client which offers the connection.
Definition at line 206 of file TraCIAPI.h.