![]() |
SUMO - Simulation of Urban MObility
|
C++ TraCI client API implementation. More...
#include <TraCI_Vehicle.h>
Data Structures | |
struct | BestLanesData |
struct | NextTLSData |
Static Public Member Functions | |
Value retrieval | |
static std::vector< std::string > | getIDList () |
static int | getIDCount () |
static double | getSpeed (const std::string &vehicleID) |
static double | getSpeedWithoutTraCI (const std::string &vehicleID) |
static TraCIPosition | getPosition (const std::string &vehicleID) |
static TraCIPosition | getPosition3D (const std::string &vehicleID) |
static double | getAngle (const std::string &vehicleID) |
static double | getSlope (const std::string &vehicleID) |
static std::string | getRoadID (const std::string &vehicleID) |
static std::string | getLaneID (const std::string &vehicleID) |
static int | getLaneIndex (const std::string &vehicleID) |
static std::string | getTypeID (const std::string &vehicleID) |
static std::string | getRouteID (const std::string &vehicleID) |
static int | getRouteIndex (const std::string &vehicleID) |
static TraCIColor | getColor (const std::string &vehicleID) |
static double | getLanePosition (const std::string &vehicleID) |
static double | getLateralLanePosition (const std::string &vehicleID) |
static double | getCO2Emission (const std::string &vehicleID) |
static double | getCOEmission (const std::string &vehicleID) |
static double | getHCEmission (const std::string &vehicleID) |
static double | getPMxEmission (const std::string &vehicleID) |
static double | getNOxEmission (const std::string &vehicleID) |
static double | getFuelConsumption (const std::string &vehicleID) |
static double | getNoiseEmission (const std::string &vehicleID) |
static double | getElectricityConsumption (const std::string &vehicleID) |
static int | getPersonNumber (const std::string &vehicleID) |
static std::pair< std::string, double > | getLeader (const std::string &vehicleID, double dist) |
static double | getWaitingTime (const std::string &vehicleID) |
static double | getAdaptedTraveltime (const std::string &vehicleID, const std::string &edgeID, int time) |
static double | getEffort (const std::string &vehicleID, const std::string &edgeID, int time) |
static bool | isRouteValid (const std::string &vehicleID) |
static std::vector< std::string > | getEdges (const std::string &vehicleID) |
static int | getSignalStates (const std::string &vehicleID) |
static std::vector< BestLanesData > | getBestLanes (const std::string &vehicleID) |
static std::vector< NextTLSData > | getNextTLS (const std::string &vehicleID) |
static int | getStopState (const std::string &vehicleID) |
static double | getDistance (const std::string &vehicleID) |
static double | getDrivingDistance (const std::string &vehicleID, const std::string &edgeID, double position, int laneIndex) |
static double | getDrivingDistance2D (const std::string &vehicleID, double x, double y) |
static double | getAllowedSpeed (const std::string &vehicleID) |
static double | getSpeedFactor (const std::string &vehicleID) |
static int | getSpeedMode (const std::string &vehicleID) |
static std::string | getLine (const std::string &vehicleID) |
static std::vector< std::string > | getVia (const std::string &vehicleID) |
static std::pair< int, int > | getLaneChangeState (const std::string &vehicleID, int direction) |
static std::string | getParameter (const std::string &vehicleID, const std::string &key) |
static const MSVehicleType & | getVehicleType (const std::string &vehicleID) |
State Changing | |
static void | setStop (const std::string &vehicleID, const std::string &edgeID, double endPos=1., int laneIndex=0, SUMOTime duration=4294967295u, int flags=STOP_DEFAULT, double startPos=INVALID_DOUBLE_VALUE, SUMOTime until=-1) |
static void | resume (const std::string &vehicleID) |
static 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) |
static void | changeLane (const std::string &vehID, int laneIndex, SUMOTime duration) |
static void | moveTo (const std::string &vehicleID, const std::string &laneID, double position) |
static void | moveToXY (const std::string &vehicleID, const std::string &edgeID, const int lane, const double x, const double y, const double angle, const int keepRoute) |
static void | slowDown (const std::string &vehicleID, double speed, int duration) |
static void | setSpeed (const std::string &vehicleID, double speed) |
static void | setMaxSpeed (const std::string &vehicleID, double speed) |
static void | remove (const std::string &vehicleID, char reason=REMOVE_VAPORIZED) |
static void | setColor (const std::string &vehicleID, const TraCIColor &c) |
static void | setLine (const std::string &vehicleID, const std::string &line) |
static void | setVia (const std::string &vehicleID, const std::vector< std::string > &via) |
static void | setShapeClass (const std::string &vehicleID, const std::string &clazz) |
static void | setEmissionClass (const std::string &vehicleID, const std::string &clazz) |
static void | setParameter (const std::string &vehicleID, const std::string &key, const std::string &value) |
Private Member Functions | |
TraCI_Vehicle & | operator= (const TraCI_Vehicle &src) |
invalidated assignment operator More... | |
TraCI_Vehicle () | |
invalidated standard constructor More... | |
TraCI_Vehicle (const TraCI_Vehicle &src) | |
invalidated copy constructor More... | |
Static Private Member Functions | |
static MSVehicle * | getVehicle (const std::string &id) |
static bool | isVisible (const MSVehicle *veh) |
static bool | onInit (const std::string &vehicleID) |
C++ TraCI client API implementation.
Definition at line 53 of file TraCI_Vehicle.h.
|
private |
invalidated standard constructor
|
private |
invalidated copy constructor
|
static |
Definition at line 658 of file TraCI_Vehicle.cpp.
References getVehicle().
|
static |
Definition at line 653 of file TraCI_Vehicle.cpp.
|
static |
Definition at line 267 of file TraCI_Vehicle.cpp.
References TraCI::getEdge(), getVehicle(), MSVehicle::getWeightsStorage(), INVALID_DOUBLE_VALUE, and MSEdgeWeightsStorage::retrieveExistingTravelTime().
Referenced by TraCIServerAPI_Vehicle::processGet().
|
static |
Definition at line 435 of file TraCI_Vehicle.cpp.
References MSVehicle::getLane(), getVehicle(), MSLane::getVehicleMaxSpeed(), INVALID_DOUBLE_VALUE, and MSVehicle::isOnRoad().
Referenced by TraCIServerAPI_Vehicle::processGet().
|
static |
Definition at line 126 of file TraCI_Vehicle.cpp.
References MSVehicle::getAngle(), getVehicle(), INVALID_DOUBLE_VALUE, isVisible(), and GeomHelper::naviDegree().
Referenced by TraCIServerAPI_Vehicle::processGet().
|
static |
Definition at line 310 of file TraCI_Vehicle.cpp.
References TraCI_Vehicle::BestLanesData::allowsContinuation, MSVehicle::LaneQ::allowsContinuation, MSVehicle::LaneQ::bestContinuations, TraCI_Vehicle::BestLanesData::bestLaneOffset, MSVehicle::LaneQ::bestLaneOffset, TraCI_Vehicle::BestLanesData::continuationLanes, MSVehicle::getBestLanes(), Named::getID(), getVehicle(), MSVehicle::isOnRoad(), MSVehicle::LaneQ::lane, TraCI_Vehicle::BestLanesData::laneID, TraCI_Vehicle::BestLanesData::length, MSVehicle::LaneQ::length, TraCI_Vehicle::BestLanesData::nextOccupation, and MSVehicle::LaneQ::nextOccupation.
Referenced by TraCIServerAPI_Vehicle::processGet().
|
static |
Definition at line 193 of file TraCI_Vehicle.cpp.
References MSVehicle::getCO2Emissions(), getVehicle(), INVALID_DOUBLE_VALUE, and isVisible().
Referenced by TraCIServerAPI_Vehicle::processGet().
|
static |
Definition at line 199 of file TraCI_Vehicle.cpp.
References MSVehicle::getCOEmissions(), getVehicle(), INVALID_DOUBLE_VALUE, and isVisible().
Referenced by TraCIServerAPI_Vehicle::processGet().
|
static |
Definition at line 176 of file TraCI_Vehicle.cpp.
References getParameter(), getVehicle(), and TraCI::makeTraCIColor().
Referenced by TraCIServerAPI_Vehicle::processGet().
|
static |
Definition at line 385 of file TraCI_Vehicle.cpp.
References MSBaseVehicle::getDepartPos(), MSRoute::getDistanceBetween(), MSLane::getEdge(), MSRoute::getEdges(), MSVehicle::getLane(), MSVehicle::getPositionOnLane(), MSBaseVehicle::getRoute(), getVehicle(), INVALID_DOUBLE_VALUE, MSVehicle::isOnRoad(), and max.
Referenced by TraCIServerAPI_Vehicle::processGet().
|
static |
Definition at line 401 of file TraCI_Vehicle.cpp.
References MSRoute::getDistanceBetween(), TraCI::getEdge(), MSBaseVehicle::getEdge(), MSVehicle::getPositionOnLane(), MSBaseVehicle::getRoute(), getVehicle(), INVALID_DOUBLE_VALUE, MSVehicle::isOnRoad(), and max.
Referenced by TraCIServerAPI_Vehicle::processGet().
|
static |
Definition at line 417 of file TraCI_Vehicle.cpp.
References TraCI::convertCartesianToRoadMap(), MSRoute::getDistanceBetween(), MSBaseVehicle::getEdge(), MSVehicle::getPositionOnLane(), MSBaseVehicle::getRoute(), getVehicle(), INVALID_DOUBLE_VALUE, MSVehicle::isOnRoad(), and max.
Referenced by TraCIServerAPI_Vehicle::processGet().
|
static |
Definition at line 293 of file TraCI_Vehicle.cpp.
References MSRoute::begin(), MSRoute::end(), MSBaseVehicle::getRoute(), and getVehicle().
Referenced by TraCIServerAPI_Vehicle::processGet().
|
static |
Definition at line 277 of file TraCI_Vehicle.cpp.
References TraCI::getEdge(), getVehicle(), MSVehicle::getWeightsStorage(), INVALID_DOUBLE_VALUE, and MSEdgeWeightsStorage::retrieveExistingEffort().
Referenced by TraCIServerAPI_Vehicle::processGet().
|
static |
Definition at line 235 of file TraCI_Vehicle.cpp.
References MSVehicle::getElectricityConsumption(), getVehicle(), INVALID_DOUBLE_VALUE, and isVisible().
Referenced by TraCIServerAPI_Vehicle::processGet().
|
static |
Definition at line 223 of file TraCI_Vehicle.cpp.
References MSVehicle::getFuelConsumption(), getVehicle(), INVALID_DOUBLE_VALUE, and isVisible().
Referenced by TraCIServerAPI_Vehicle::processGet().
|
static |
Definition at line 205 of file TraCI_Vehicle.cpp.
References MSVehicle::getHCEmissions(), getVehicle(), INVALID_DOUBLE_VALUE, and isVisible().
Referenced by TraCIServerAPI_Vehicle::processGet().
|
static |
Definition at line 92 of file TraCI_Vehicle.cpp.
References getIDList().
Referenced by TraCIServerAPI_Vehicle::processGet().
|
static |
Definition at line 80 of file TraCI_Vehicle.cpp.
References MSNet::getInstance(), MSNet::getVehicleControl(), MSVehicleControl::loadedVehBegin(), and MSVehicleControl::loadedVehEnd().
Referenced by getIDCount(), and TraCIServerAPI_Vehicle::processGet().
|
static |
Definition at line 467 of file TraCI_Vehicle.cpp.
References MSVehicle::getLaneChangeModel(), MSAbstractLaneChangeModel::getSavedState(), getVehicle(), MSVehicle::isOnRoad(), and LCA_UNKNOWN.
Referenced by TraCIServerAPI_Vehicle::processGet().
|
static |
Definition at line 147 of file TraCI_Vehicle.cpp.
References Named::getID(), MSVehicle::getLane(), getVehicle(), and MSVehicle::isOnRoad().
Referenced by TraCIServerAPI_Vehicle::processGet().
|
static |
Definition at line 154 of file TraCI_Vehicle.cpp.
References MSLane::getIndex(), MSVehicle::getLane(), getVehicle(), INVALID_INT_VALUE, and MSVehicle::isOnRoad().
Referenced by TraCIServerAPI_Vehicle::processGet().
|
static |
Definition at line 181 of file TraCI_Vehicle.cpp.
References MSVehicle::getPositionOnLane(), getVehicle(), INVALID_DOUBLE_VALUE, and MSVehicle::isOnRoad().
Referenced by TraCIServerAPI_Vehicle::processGet().
|
static |
Definition at line 187 of file TraCI_Vehicle.cpp.
References MSVehicle::getLateralPositionOnLane(), getVehicle(), INVALID_DOUBLE_VALUE, and MSVehicle::isOnRoad().
Referenced by TraCIServerAPI_Vehicle::processGet().
|
static |
Definition at line 247 of file TraCI_Vehicle.cpp.
References MSVehicle::getLeader(), getVehicle(), and MSVehicle::isOnRoad().
Referenced by TraCIServerAPI_Vehicle::processGet().
|
static |
Definition at line 456 of file TraCI_Vehicle.cpp.
References MSBaseVehicle::getParameter(), getVehicle(), and SUMOVehicleParameter::line.
Referenced by TraCIServerAPI_Vehicle::processGet().
|
static |
Definition at line 336 of file TraCI_Vehicle.cpp.
References TraCI_Vehicle::NextTLSData::dist, MSVehicle::getBestLanesContinuation(), MSLane::getEdge(), MSVehicle::getLane(), MSLane::getLength(), MSVehicle::getPositionOnLane(), getVehicle(), TraCI_Vehicle::NextTLSData::id, MSEdge::isInternal(), MSLane::isLinkEnd(), MSVehicle::isOnRoad(), TraCI_Vehicle::NextTLSData::state, MSLane::succLinkSec(), and TraCI_Vehicle::NextTLSData::tlIndex.
Referenced by TraCIServerAPI_Vehicle::processGet().
|
static |
Definition at line 229 of file TraCI_Vehicle.cpp.
References MSVehicle::getHarmonoise_NoiseEmissions(), getVehicle(), INVALID_DOUBLE_VALUE, and isVisible().
Referenced by TraCIServerAPI_Vehicle::processGet().
|
static |
Definition at line 217 of file TraCI_Vehicle.cpp.
References MSVehicle::getNOxEmissions(), getVehicle(), INVALID_DOUBLE_VALUE, and isVisible().
Referenced by TraCIServerAPI_Vehicle::processGet().
|
static |
Definition at line 478 of file TraCI_Vehicle.cpp.
References StringUtils::endsWith(), StringTokenizer::get(), MSBaseVehicle::getDeviceParameter(), MSVehicle::getLaneChangeModel(), MSBaseVehicle::getParameter(), Parameterised::getParameter(), MSAbstractLaneChangeModel::getParameter(), getVehicle(), MSBaseVehicle::hasDevice(), StringTokenizer::size(), and StringUtils::startsWith().
Referenced by getColor(), and TraCIServerAPI_Vehicle::processGet().
|
static |
Definition at line 241 of file TraCI_Vehicle.cpp.
References MSVehicle::getPersonNumber(), and getVehicle().
Referenced by TraCIServerAPI_Vehicle::processGet().
|
static |
Definition at line 211 of file TraCI_Vehicle.cpp.
References MSVehicle::getPMxEmissions(), getVehicle(), INVALID_DOUBLE_VALUE, and isVisible().
Referenced by TraCIServerAPI_Vehicle::processGet().
|
static |
Definition at line 111 of file TraCI_Vehicle.cpp.
References MSVehicle::getPosition(), getVehicle(), INVALID_DOUBLE_VALUE, isVisible(), TraCI::makeTraCIPosition(), TraCIPosition::x, TraCIPosition::y, and TraCIPosition::z.
Referenced by TraCIServerAPI_Vehicle::processGet().
|
static |
|
static |
Definition at line 140 of file TraCI_Vehicle.cpp.
References MSLane::getEdge(), Named::getID(), MSVehicle::getLane(), getVehicle(), and isVisible().
Referenced by TraCIServerAPI_Vehicle::processGet().
|
static |
Definition at line 165 of file TraCI_Vehicle.cpp.
References Named::getID(), MSBaseVehicle::getRoute(), and getVehicle().
Referenced by TraCIServerAPI_Vehicle::processGet().
|
static |
Definition at line 170 of file TraCI_Vehicle.cpp.
References MSVehicle::getRoutePosition(), getVehicle(), MSBaseVehicle::hasDeparted(), and INVALID_INT_VALUE.
Referenced by TraCIServerAPI_Vehicle::processGet().
|
static |
Definition at line 305 of file TraCI_Vehicle.cpp.
References MSVehicle::getSignals(), and getVehicle().
Referenced by TraCIServerAPI_Vehicle::processGet().
|
static |
Definition at line 133 of file TraCI_Vehicle.cpp.
References MSVehicle::getSlope(), getVehicle(), INVALID_DOUBLE_VALUE, and MSVehicle::isOnRoad().
Referenced by TraCIServerAPI_Vehicle::processGet().
|
static |
Definition at line 97 of file TraCI_Vehicle.cpp.
References MSVehicle::getSpeed(), getVehicle(), INVALID_DOUBLE_VALUE, and isVisible().
Referenced by TraCIServerAPI_Vehicle::processGet().
|
static |
Definition at line 445 of file TraCI_Vehicle.cpp.
References MSBaseVehicle::getChosenSpeedFactor(), and getVehicle().
Referenced by TraCIServerAPI_Vehicle::processGet().
|
static |
Definition at line 451 of file TraCI_Vehicle.cpp.
References MSVehicle::getInfluencer(), MSVehicle::Influencer::getSpeedMode(), and getVehicle().
Referenced by TraCIServerAPI_Vehicle::processGet().
|
static |
Definition at line 104 of file TraCI_Vehicle.cpp.
References MSVehicle::getSpeedWithoutTraciInfluence(), getVehicle(), INVALID_DOUBLE_VALUE, and isVisible().
Referenced by TraCIServerAPI_Vehicle::processGet().
|
static |
Definition at line 368 of file TraCI_Vehicle.cpp.
References MSVehicle::Stop::busstop, MSVehicle::Stop::chargingStation, MSVehicle::Stop::containerstop, MSVehicle::Stop::containerTriggered, MSVehicle::getNextStop(), getVehicle(), MSVehicle::isStopped(), MSVehicle::Stop::parking, MSVehicle::Stop::parkingarea, and MSVehicle::Stop::triggered.
Referenced by TraCIServerAPI_Vehicle::processGet().
|
static |
Definition at line 160 of file TraCI_Vehicle.cpp.
References MSVehicleType::getID(), getVehicle(), and MSBaseVehicle::getVehicleType().
Referenced by TraCIServerAPI_Vehicle::processGet().
|
staticprivate |
Definition at line 54 of file TraCI_Vehicle.cpp.
References MSNet::getInstance(), MSVehicleControl::getVehicle(), and MSNet::getVehicleControl().
Referenced by add(), getAdaptedTraveltime(), getAllowedSpeed(), getAngle(), getBestLanes(), getCO2Emission(), getCOEmission(), getColor(), getDistance(), getDrivingDistance(), getDrivingDistance2D(), getEdges(), getEffort(), getElectricityConsumption(), getFuelConsumption(), getHCEmission(), getLaneChangeState(), getLaneID(), getLaneIndex(), getLanePosition(), getLateralLanePosition(), getLeader(), getLine(), getNextTLS(), getNoiseEmission(), getNOxEmission(), getParameter(), getPersonNumber(), getPMxEmission(), getPosition(), getRoadID(), getRouteID(), getRouteIndex(), getSignalStates(), getSlope(), getSpeed(), getSpeedFactor(), getSpeedMode(), getSpeedWithoutTraCI(), getStopState(), getTypeID(), getVehicleType(), getVia(), getWaitingTime(), isRouteValid(), resume(), setParameter(), and setStop().
|
static |
Definition at line 510 of file TraCI_Vehicle.cpp.
References getVehicle(), and MSBaseVehicle::getVehicleType().
Referenced by TraCIServerAPI_Vehicle::processGet().
|
static |
Definition at line 461 of file TraCI_Vehicle.cpp.
References MSBaseVehicle::getParameter(), getVehicle(), and SUMOVehicleParameter::via.
Referenced by TraCIServerAPI_Vehicle::processGet().
|
static |
Definition at line 261 of file TraCI_Vehicle.cpp.
References getVehicle(), and MSVehicle::getWaitingSeconds().
Referenced by TraCIServerAPI_Vehicle::processGet().
|
static |
Definition at line 287 of file TraCI_Vehicle.cpp.
References getVehicle(), and MSBaseVehicle::hasValidRoute().
Referenced by TraCIServerAPI_Vehicle::processGet().
|
staticprivate |
Definition at line 68 of file TraCI_Vehicle.cpp.
References MSVehicle::isOnRoad(), MSVehicle::isParking(), and MSVehicle::wasRemoteControlled().
Referenced by getAngle(), getCO2Emission(), getCOEmission(), getElectricityConsumption(), getFuelConsumption(), getHCEmission(), getNoiseEmission(), getNOxEmission(), getPMxEmission(), getPosition(), getRoadID(), getSpeed(), and getSpeedWithoutTraCI().
|
static |
Definition at line 680 of file TraCI_Vehicle.cpp.
|
static |
Definition at line 684 of file TraCI_Vehicle.cpp.
|
staticprivate |
Definition at line 74 of file TraCI_Vehicle.cpp.
References MSNet::getInstance(), SUMOVehicle::getLane(), MSVehicleControl::getVehicle(), and MSNet::getVehicleControl().
|
private |
invalidated assignment operator
|
static |
Definition at line 700 of file TraCI_Vehicle.cpp.
|
static |
Definition at line 634 of file TraCI_Vehicle.cpp.
References MSVehicle::Stop::duration, MSVehicle::Stop::edge, MSBaseVehicle::getID(), MSVehicle::getNextStop(), getVehicle(), MSVehicle::hasStops(), MSVehicle::Stop::reached, MSVehicle::resumeFromStopping(), and MSVehicle::Stop::startPos.
Referenced by TraCIServerAPI_Vehicle::processSet().
|
static |
Definition at line 704 of file TraCI_Vehicle.cpp.
|
static |
Definition at line 720 of file TraCI_Vehicle.cpp.
|
static |
Definition at line 708 of file TraCI_Vehicle.cpp.
|
static |
Definition at line 696 of file TraCI_Vehicle.cpp.
|
static |
Definition at line 725 of file TraCI_Vehicle.cpp.
References TplConvert::_2bool(), MSBaseVehicle::createDevice(), StringUtils::endsWith(), StringTokenizer::get(), MSVehicle::getLaneChangeModel(), MSBaseVehicle::getParameter(), getVehicle(), MSBaseVehicle::setDeviceParameter(), MSAbstractLaneChangeModel::setParameter(), StringTokenizer::size(), and StringUtils::startsWith().
Referenced by TraCIServerAPI_Vehicle::processSet().
|
static |
Definition at line 716 of file TraCI_Vehicle.cpp.
|
static |
Definition at line 692 of file TraCI_Vehicle.cpp.
|
static |
Definition at line 571 of file TraCI_Vehicle.cpp.
References MSVehicle::addTraciStop(), MSVehicle::addTraciStopAtStoppingPlace(), MSEdge::dictionary(), MSEdge::getLanes(), getVehicle(), SUMO_TAG_BUS_STOP, SUMO_TAG_CHARGING_STATION, SUMO_TAG_NOTHING, SUMO_TAG_PARKING_AREA, and toString().
Referenced by TraCIServerAPI_Vehicle::processSet().
|
static |
Definition at line 712 of file TraCI_Vehicle.cpp.
|
static |
Definition at line 688 of file TraCI_Vehicle.cpp.