![]() |
Eclipse SUMO - Simulation of Urban MObility
|
Scope for interaction with edges. More...
#include <TraCIAPI.h>
Public Member Functions | |
void | adaptTraveltime (const std::string &edgeID, double time, double beginSeconds=0., double endSeconds=std::numeric_limits< double >::max()) const |
void | clearSubscriptionResults () |
EdgeScope (TraCIAPI &parent) | |
double | getAdaptedTraveltime (const std::string &edgeID, double time) const |
const libsumo::ContextSubscriptionResults | getAllContextSubscriptionResults () const |
const libsumo::SubscriptionResults | getAllSubscriptionResults () const |
double | getCO2Emission (const std::string &edgeID) const |
double | getCOEmission (const std::string &edgeID) const |
const libsumo::SubscriptionResults | getContextSubscriptionResults (const std::string &objID) const |
double | getEffort (const std::string &edgeID, double time) const |
double | getElectricityConsumption (const std::string &edgeID) const |
double | getFuelConsumption (const std::string &edgeID) const |
double | getHCEmission (const std::string &edgeID) const |
int | getIDCount () const |
std::vector< std::string > | getIDList () const |
int | getLaneNumber (const std::string &edgeID) const |
double | getLastStepHaltingNumber (const std::string &edgeID) const |
double | getLastStepLength (const std::string &edgeID) const |
double | getLastStepMeanSpeed (const std::string &edgeID) const |
double | getLastStepOccupancy (const std::string &edgeID) const |
std::vector< std::string > | getLastStepVehicleIDs (const std::string &edgeID) const |
int | getLastStepVehicleNumber (const std::string &edgeID) const |
libsumo::SubscriptionResults & | getModifiableContextSubscriptionResults (const std::string &objID) |
libsumo::SubscriptionResults & | getModifiableSubscriptionResults () |
double | getNoiseEmission (const std::string &edgeID) const |
double | getNOxEmission (const std::string &edgeID) const |
std::string | getParameter (const std::string &objectID, const std::string &key) const |
retrieve generic parameter | |
std::pair< std::string, std::string > | getParameterWithKey (const std::string &objectID, const std::string &key) const |
retrieve generic parameter and return (key, value) tuple | |
double | getPMxEmission (const std::string &edgeID) const |
std::string | getStreetName (const std::string &id) const |
const libsumo::TraCIResults | getSubscriptionResults (const std::string &objID) const |
double | getTraveltime (const std::string &edgeID) const |
void | setEffort (const std::string &edgeID, double effort, double beginSeconds=0., double endSeconds=std::numeric_limits< double >::max()) const |
void | setMaxSpeed (const std::string &edgeID, double speed) const |
void | setParameter (const std::string &objectID, const std::string &key, const std::string &value) const |
set generic paramter | |
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 | ~EdgeScope () |
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 |
std::vector< double > | getDoubleVector (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. | |
Private Attributes | |
int | myCmdGetID |
int | myCmdSetID |
int | myContextSubscribeID |
libsumo::ContextSubscriptionResults | myContextSubscriptionResults |
int | mySubscribeID |
libsumo::SubscriptionResults | mySubscriptionResults |
Scope for interaction with edges.
Definition at line 171 of file TraCIAPI.h.
|
inline |
Definition at line 173 of file TraCIAPI.h.
|
inlinevirtual |
Definition at line 174 of file TraCIAPI.h.
void TraCIAPI::EdgeScope::adaptTraveltime | ( | const std::string & | edgeID, |
double | time, | ||
double | beginSeconds = 0. , |
||
double | endSeconds = std::numeric_limits<double>::max() |
||
) | const |
Definition at line 601 of file TraCIAPI.cpp.
References libsumo::CMD_SET_EDGE_VARIABLE, libsumo::TYPE_COMPOUND, libsumo::TYPE_DOUBLE, libsumo::VAR_EDGE_TRAVELTIME, tcpip::Storage::writeByte(), tcpip::Storage::writeDouble(), and tcpip::Storage::writeInt().
Referenced by TraCITestClient::testAPI().
|
inherited |
Definition at line 3888 of file TraCIAPI.cpp.
double TraCIAPI::EdgeScope::getAdaptedTraveltime | ( | const std::string & | edgeID, |
double | time | ||
) | const |
Definition at line 496 of file TraCIAPI.cpp.
References TraCIAPI::TraCIScopeWrapper::getDouble(), libsumo::TYPE_DOUBLE, libsumo::VAR_EDGE_TRAVELTIME, tcpip::Storage::writeByte(), and tcpip::Storage::writeDouble().
Referenced by TraCITestClient::testAPI().
|
inherited |
Definition at line 3872 of file TraCIAPI.cpp.
|
inherited |
Definition at line 3856 of file TraCIAPI.cpp.
|
protectedinherited |
Definition at line 3558 of file TraCIAPI.cpp.
References libsumo::INVALID_INT_VALUE, and libsumo::TYPE_BYTE.
double TraCIAPI::EdgeScope::getCO2Emission | ( | const std::string & | edgeID | ) | const |
Definition at line 512 of file TraCIAPI.cpp.
References libsumo::VAR_CO2EMISSION.
double TraCIAPI::EdgeScope::getCOEmission | ( | const std::string & | edgeID | ) | const |
Definition at line 518 of file TraCIAPI.cpp.
References libsumo::VAR_COEMISSION.
|
protectedinherited |
Definition at line 3674 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 3878 of file TraCIAPI.cpp.
Referenced by TraCITestClient::testAPI().
|
protectedinherited |
Definition at line 3579 of file TraCIAPI.cpp.
References libsumo::INVALID_DOUBLE_VALUE, and libsumo::TYPE_DOUBLE.
Referenced by getAdaptedTraveltime().
|
protectedinherited |
Definition at line 3660 of file TraCIAPI.cpp.
References libsumo::TYPE_DOUBLELIST.
double TraCIAPI::EdgeScope::getEffort | ( | const std::string & | edgeID, |
double | time | ||
) | const |
Definition at line 504 of file TraCIAPI.cpp.
References libsumo::TYPE_DOUBLE, libsumo::VAR_EDGE_EFFORT, tcpip::Storage::writeByte(), and tcpip::Storage::writeDouble().
Referenced by TraCITestClient::testAPI().
double TraCIAPI::EdgeScope::getElectricityConsumption | ( | const std::string & | edgeID | ) | const |
Definition at line 548 of file TraCIAPI.cpp.
References libsumo::VAR_ELECTRICITYCONSUMPTION.
double TraCIAPI::EdgeScope::getFuelConsumption | ( | const std::string & | edgeID | ) | const |
Definition at line 538 of file TraCIAPI.cpp.
References libsumo::VAR_FUELCONSUMPTION.
double TraCIAPI::EdgeScope::getHCEmission | ( | const std::string & | edgeID | ) | const |
Definition at line 523 of file TraCIAPI.cpp.
References libsumo::VAR_HCEMISSION.
|
inherited |
Definition at line 3743 of file TraCIAPI.cpp.
References libsumo::ID_COUNT.
Referenced by TraCITestClient::testAPI().
|
inherited |
Definition at line 3737 of file TraCIAPI.cpp.
References libsumo::TRACI_ID_LIST.
Referenced by TraCITestClient::testAPI().
|
protectedinherited |
Definition at line 3569 of file TraCIAPI.cpp.
References libsumo::INVALID_INT_VALUE, and libsumo::TYPE_INTEGER.
int TraCIAPI::EdgeScope::getLaneNumber | ( | const std::string & | edgeID | ) | const |
Definition at line 589 of file TraCIAPI.cpp.
References libsumo::VAR_LANE_INDEX.
Referenced by TraCITestClient::testAPI().
double TraCIAPI::EdgeScope::getLastStepHaltingNumber | ( | const std::string & | edgeID | ) | const |
Definition at line 578 of file TraCIAPI.cpp.
References libsumo::LAST_STEP_VEHICLE_HALTING_NUMBER.
double TraCIAPI::EdgeScope::getLastStepLength | ( | const std::string & | edgeID | ) | const |
Definition at line 563 of file TraCIAPI.cpp.
References libsumo::LAST_STEP_LENGTH.
double TraCIAPI::EdgeScope::getLastStepMeanSpeed | ( | const std::string & | edgeID | ) | const |
Definition at line 553 of file TraCIAPI.cpp.
References libsumo::LAST_STEP_MEAN_SPEED.
double TraCIAPI::EdgeScope::getLastStepOccupancy | ( | const std::string & | edgeID | ) | const |
Definition at line 558 of file TraCIAPI.cpp.
References libsumo::LAST_STEP_OCCUPANCY.
std::vector< std::string > TraCIAPI::EdgeScope::getLastStepVehicleIDs | ( | const std::string & | edgeID | ) | const |
Definition at line 583 of file TraCIAPI.cpp.
References libsumo::LAST_STEP_VEHICLE_ID_LIST.
int TraCIAPI::EdgeScope::getLastStepVehicleNumber | ( | const std::string & | edgeID | ) | const |
Definition at line 573 of file TraCIAPI.cpp.
References libsumo::LAST_STEP_VEHICLE_NUMBER.
|
inherited |
Definition at line 3901 of file TraCIAPI.cpp.
|
inherited |
Definition at line 3895 of file TraCIAPI.cpp.
double TraCIAPI::EdgeScope::getNoiseEmission | ( | const std::string & | edgeID | ) | const |
Definition at line 543 of file TraCIAPI.cpp.
References libsumo::VAR_NOISEEMISSION.
double TraCIAPI::EdgeScope::getNOxEmission | ( | const std::string & | edgeID | ) | const |
Definition at line 533 of file TraCIAPI.cpp.
References libsumo::VAR_NOXEMISSION.
|
inherited |
retrieve generic parameter
Definition at line 3749 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 3758 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().
double TraCIAPI::EdgeScope::getPMxEmission | ( | const std::string & | edgeID | ) | const |
Definition at line 528 of file TraCIAPI.cpp.
References libsumo::VAR_PMXEMISSION.
|
protectedinherited |
Definition at line 3589 of file TraCIAPI.cpp.
References libsumo::TYPE_POLYGON, libsumo::TraCIPositionVector::value, libsumo::TraCIPosition::x, libsumo::TraCIPosition::y, and libsumo::TraCIPosition::z.
|
protectedinherited |
Definition at line 3610 of file TraCIAPI.cpp.
References libsumo::POSITION_2D, libsumo::TraCIPosition::x, libsumo::TraCIPosition::y, and libsumo::TraCIPosition::z.
|
protectedinherited |
Definition at line 3623 of file TraCIAPI.cpp.
References libsumo::POSITION_3D, libsumo::TraCIPosition::x, libsumo::TraCIPosition::y, and libsumo::TraCIPosition::z.
std::string TraCIAPI::EdgeScope::getStreetName | ( | const std::string & | id | ) | const |
Definition at line 595 of file TraCIAPI.cpp.
References libsumo::VAR_NAME.
Referenced by TraCITestClient::testAPI().
|
protectedinherited |
Definition at line 3636 of file TraCIAPI.cpp.
References libsumo::TYPE_STRING.
|
protectedinherited |
Definition at line 3646 of file TraCIAPI.cpp.
References libsumo::TYPE_STRINGLIST.
|
inherited |
Definition at line 3862 of file TraCIAPI.cpp.
Referenced by TraCITestClient::testAPI().
|
protectedinherited |
Definition at line 3688 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.
double TraCIAPI::EdgeScope::getTraveltime | ( | const std::string & | edgeID | ) | const |
Definition at line 568 of file TraCIAPI.cpp.
References libsumo::VAR_CURRENT_TRAVELTIME.
Referenced by TraCITestClient::testAPI().
|
protectedinherited |
Definition at line 3548 of file TraCIAPI.cpp.
References libsumo::INVALID_INT_VALUE, and libsumo::TYPE_UBYTE.
|
protectedinherited |
Definition at line 3801 of file TraCIAPI.cpp.
References libsumo::TYPE_DOUBLE, tcpip::Storage::writeDouble(), and tcpip::Storage::writeUnsignedByte().
void TraCIAPI::EdgeScope::setEffort | ( | const std::string & | edgeID, |
double | effort, | ||
double | beginSeconds = 0. , |
||
double | endSeconds = std::numeric_limits<double>::max() |
||
) | const |
Definition at line 621 of file TraCIAPI.cpp.
References libsumo::CMD_SET_EDGE_VARIABLE, libsumo::TYPE_COMPOUND, libsumo::TYPE_DOUBLE, libsumo::VAR_EDGE_EFFORT, tcpip::Storage::writeByte(), tcpip::Storage::writeDouble(), and tcpip::Storage::writeInt().
Referenced by TraCITestClient::testAPI().
|
protectedinherited |
Definition at line 3791 of file TraCIAPI.cpp.
References libsumo::TYPE_INTEGER, tcpip::Storage::writeInt(), and tcpip::Storage::writeUnsignedByte().
void TraCIAPI::EdgeScope::setMaxSpeed | ( | const std::string & | edgeID, |
double | speed | ||
) | const |
Definition at line 640 of file TraCIAPI.cpp.
References libsumo::VAR_MAXSPEED.
Referenced by TraCITestClient::testAPI().
|
inherited |
set generic paramter
Definition at line 3777 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 3811 of file TraCIAPI.cpp.
References libsumo::TYPE_STRING, tcpip::Storage::writeString(), and tcpip::Storage::writeUnsignedByte().
|
protectedinherited |
Definition at line 3821 of file TraCIAPI.cpp.
References libsumo::TYPE_STRINGLIST, tcpip::Storage::writeInt(), tcpip::Storage::writeString(), and tcpip::Storage::writeUnsignedByte().
|
inherited |
Definition at line 3834 of file TraCIAPI.cpp.
Referenced by TraCITestClient::testAPI().
|
inherited |
Definition at line 3846 of file TraCIAPI.cpp.
Referenced by TraCITestClient::testAPI().
|
privateinherited |
Definition at line 154 of file TraCIAPI.h.
|
privateinherited |
Definition at line 155 of file TraCIAPI.h.
|
privateinherited |
Definition at line 157 of file TraCIAPI.h.
|
privateinherited |
Definition at line 159 of file TraCIAPI.h.
|
protectedinherited |
The parent TraCI client which offers the connection.
Definition at line 151 of file TraCIAPI.h.
|
privateinherited |
Definition at line 156 of file TraCIAPI.h.
|
privateinherited |
Definition at line 158 of file TraCIAPI.h.