SUMO - Simulation of Urban MObility
TraCI_Vehicle Class Reference

C++ TraCI client API implementation. More...

#include <TraCI_Vehicle.h>

Collaboration diagram for TraCI_Vehicle:
Collaboration graph

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 getAccumulatedWaitingTime (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< TraCIBestLanesDatagetBestLanes (const std::string &vehicleID)
 
static std::vector< TraCINextTLSDatagetNextTLS (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 int getLanechangeMode (const std::string &vehicleID)
 
static int getRoutingMode (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 MSVehicleTypegetVehicleType (const std::string &vehicleID)
 
vehicle type value retrieval shortcuts
static std::string getEmissionClass (const std::string &vehicleID)
 
static std::string getShapeClass (const std::string &vehicleID)
 
static std::string getVClass (const std::string &vehicleID)
 
static double getLength (const std::string &vehicleID)
 
static double getAccel (const std::string &vehicleID)
 
static double getDecel (const std::string &vehicleID)
 
static double getEmergencyDecel (const std::string &vehicleID)
 
static double getApparentDecel (const std::string &vehicleID)
 
static double getActionStepLength (const std::string &vehicleID)
 
static double getLastActionTime (const std::string &vehicleID)
 
static double getTau (const std::string &vehicleID)
 
static double getImperfection (const std::string &vehicleID)
 
static double getSpeedDeviation (const std::string &vehicleID)
 
static double getMinGap (const std::string &vehicleID)
 
static double getMaxSpeed (const std::string &vehicleID)
 
static double getWidth (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 changeTarget (const std::string &vehicleID, const std::string &edgeID)
 
static void changeLane (const std::string &vehicleID, int laneIndex, SUMOTime duration)
 
static void changeSublane (const std::string &vehicleID, double latDist)
 
static void slowDown (const std::string &vehicleID, double speed, SUMOTime duration)
 
static void setSpeed (const std::string &vehicleID, double speed)
 
static void setType (const std::string &vehicleID, const std::string &typeID)
 
static void setRouteID (const std::string &vehicleID, const std::string &routeID)
 
static void setRoute (const std::string &vehicleID, const std::vector< std::string > &edgeIDs)
 
static void setAdaptedTraveltime (const std::string &vehicleID, const std::string &edgeID, double time=INVALID_DOUBLE_VALUE, SUMOTime begTime=0, SUMOTime endTime=SUMOTime_MAX)
 
static void setEffort (const std::string &vehicleID, const std::string &edgeID, double effort=INVALID_DOUBLE_VALUE, SUMOTime begTime=0, SUMOTime endTime=SUMOTime_MAX)
 
static void rerouteTraveltime (const std::string &vehicleID)
 
static void rerouteEffort (const std::string &vehicleID)
 
static void setSignals (const std::string &vehicleID, int signals)
 
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 setMaxSpeed (const std::string &vehicleID, double speed)
 
static void setActionStepLength (const std::string &vehicleID, double actionStepLength, bool resetActionOffset=true)
 
static void remove (const std::string &vehicleID, char reason=REMOVE_VAPORIZED)
 
static void setColor (const std::string &vehicleID, const TraCIColor &col)
 
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_Vehicleoperator= (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 MSVehiclegetVehicle (const std::string &id)
 
static bool isOnInit (const std::string &vehicleID)
 
static bool isVisible (const MSVehicle *veh)
 

Detailed Description

C++ TraCI client API implementation.

Definition at line 52 of file TraCI_Vehicle.h.

Constructor & Destructor Documentation

TraCI_Vehicle::TraCI_Vehicle ( )
private

invalidated standard constructor

TraCI_Vehicle::TraCI_Vehicle ( const TraCI_Vehicle src)
private

invalidated copy constructor

Member Function Documentation

void TraCI_Vehicle::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

Definition at line 753 of file TraCI_Vehicle.cpp.

References getVehicle(), and UNUSED_PARAMETER.

void TraCI_Vehicle::changeLane ( const std::string &  vehicleID,
int  laneIndex,
SUMOTime  duration 
)
static
void TraCI_Vehicle::changeSublane ( const std::string &  vehicleID,
double  latDist 
)
static
void TraCI_Vehicle::changeTarget ( const std::string &  vehicleID,
const std::string &  edgeID 
)
static
double TraCI_Vehicle::getAccel ( const std::string &  vehicleID)
static

Definition at line 563 of file TraCI_Vehicle.cpp.

References MSVehicleType::getLength(), and getVehicleType().

double TraCI_Vehicle::getAccumulatedWaitingTime ( const std::string &  vehicleID)
static
double TraCI_Vehicle::getActionStepLength ( const std::string &  vehicleID)
static
double TraCI_Vehicle::getAdaptedTraveltime ( const std::string &  vehicleID,
const std::string &  edgeID,
int  time 
)
static
double TraCI_Vehicle::getAllowedSpeed ( const std::string &  vehicleID)
static
double TraCI_Vehicle::getAngle ( const std::string &  vehicleID)
static
double TraCI_Vehicle::getApparentDecel ( const std::string &  vehicleID)
static
double TraCI_Vehicle::getCO2Emission ( const std::string &  vehicleID)
static
double TraCI_Vehicle::getCOEmission ( const std::string &  vehicleID)
static
TraCIColor TraCI_Vehicle::getColor ( const std::string &  vehicleID)
static
double TraCI_Vehicle::getDecel ( const std::string &  vehicleID)
static
double TraCI_Vehicle::getDrivingDistance ( const std::string &  vehicleID,
const std::string &  edgeID,
double  position,
int  laneIndex 
)
static
double TraCI_Vehicle::getDrivingDistance2D ( const std::string &  vehicleID,
double  x,
double  y 
)
static
std::vector< std::string > TraCI_Vehicle::getEdges ( const std::string &  vehicleID)
static
double TraCI_Vehicle::getEffort ( const std::string &  vehicleID,
const std::string &  edgeID,
int  time 
)
static
double TraCI_Vehicle::getElectricityConsumption ( const std::string &  vehicleID)
static
double TraCI_Vehicle::getEmergencyDecel ( const std::string &  vehicleID)
static
std::string TraCI_Vehicle::getEmissionClass ( const std::string &  vehicleID)
static

Definition at line 546 of file TraCI_Vehicle.cpp.

References PollutantsInterface::getName(), and getVehicleType().

double TraCI_Vehicle::getFuelConsumption ( const std::string &  vehicleID)
static
double TraCI_Vehicle::getHCEmission ( const std::string &  vehicleID)
static
int TraCI_Vehicle::getIDCount ( )
static

Definition at line 95 of file TraCI_Vehicle.cpp.

References getIDList().

Referenced by TraCIServerAPI_Vehicle::processGet().

std::vector< std::string > TraCI_Vehicle::getIDList ( )
static
double TraCI_Vehicle::getImperfection ( const std::string &  vehicleID)
static
int TraCI_Vehicle::getLanechangeMode ( const std::string &  vehicleID)
static
std::pair< int, int > TraCI_Vehicle::getLaneChangeState ( const std::string &  vehicleID,
int  direction 
)
static
std::string TraCI_Vehicle::getLaneID ( const std::string &  vehicleID)
static
int TraCI_Vehicle::getLaneIndex ( const std::string &  vehicleID)
static
double TraCI_Vehicle::getLanePosition ( const std::string &  vehicleID)
static
double TraCI_Vehicle::getLastActionTime ( const std::string &  vehicleID)
static

Definition at line 583 of file TraCI_Vehicle.cpp.

References getVehicle(), and STEPS2TIME.

Referenced by TraCIServerAPI_Vehicle::processGet().

double TraCI_Vehicle::getLateralLanePosition ( const std::string &  vehicleID)
static
std::pair< std::string, double > TraCI_Vehicle::getLeader ( const std::string &  vehicleID,
double  dist 
)
static
double TraCI_Vehicle::getLength ( const std::string &  vehicleID)
static

Definition at line 557 of file TraCI_Vehicle.cpp.

References MSVehicleType::getLength(), and getVehicleType().

Referenced by getDistance().

std::string TraCI_Vehicle::getLine ( const std::string &  vehicleID)
static
double TraCI_Vehicle::getMaxSpeed ( const std::string &  vehicleID)
static

Definition at line 618 of file TraCI_Vehicle.cpp.

References MSVehicleType::getMaxSpeed(), and getVehicleType().

double TraCI_Vehicle::getMinGap ( const std::string &  vehicleID)
static

Definition at line 612 of file TraCI_Vehicle.cpp.

References MSVehicleType::getMinGap(), and getVehicleType().

double TraCI_Vehicle::getNoiseEmission ( const std::string &  vehicleID)
static
double TraCI_Vehicle::getNOxEmission ( const std::string &  vehicleID)
static
int TraCI_Vehicle::getPersonNumber ( const std::string &  vehicleID)
static

Definition at line 244 of file TraCI_Vehicle.cpp.

References MSVehicle::getPersonNumber(), and getVehicle().

Referenced by TraCIServerAPI_Vehicle::processGet().

double TraCI_Vehicle::getPMxEmission ( const std::string &  vehicleID)
static
TraCIPosition TraCI_Vehicle::getPosition ( const std::string &  vehicleID)
static
static TraCIPosition TraCI_Vehicle::getPosition3D ( const std::string &  vehicleID)
static
std::string TraCI_Vehicle::getRoadID ( const std::string &  vehicleID)
static
std::string TraCI_Vehicle::getRouteID ( const std::string &  vehicleID)
static
int TraCI_Vehicle::getRouteIndex ( const std::string &  vehicleID)
static
int TraCI_Vehicle::getRoutingMode ( const std::string &  vehicleID)
static
std::string TraCI_Vehicle::getShapeClass ( const std::string &  vehicleID)
static

Definition at line 551 of file TraCI_Vehicle.cpp.

References getVehicleShapeName(), and getVehicleType().

int TraCI_Vehicle::getSignalStates ( const std::string &  vehicleID)
static

Definition at line 314 of file TraCI_Vehicle.cpp.

References MSVehicle::getSignals(), and getVehicle().

Referenced by TraCIServerAPI_Vehicle::processGet().

double TraCI_Vehicle::getSlope ( const std::string &  vehicleID)
static
double TraCI_Vehicle::getSpeed ( const std::string &  vehicleID)
static
double TraCI_Vehicle::getSpeedDeviation ( const std::string &  vehicleID)
static
double TraCI_Vehicle::getSpeedFactor ( const std::string &  vehicleID)
static
int TraCI_Vehicle::getSpeedMode ( const std::string &  vehicleID)
static
double TraCI_Vehicle::getSpeedWithoutTraCI ( const std::string &  vehicleID)
static
double TraCI_Vehicle::getTau ( const std::string &  vehicleID)
static
std::string TraCI_Vehicle::getTypeID ( const std::string &  vehicleID)
static
std::string TraCI_Vehicle::getVClass ( const std::string &  vehicleID)
static

Definition at line 606 of file TraCI_Vehicle.cpp.

References getVehicleType(), and toString().

std::vector< std::string > TraCI_Vehicle::getVia ( const std::string &  vehicleID)
static
double TraCI_Vehicle::getWaitingTime ( const std::string &  vehicleID)
static

Definition at line 264 of file TraCI_Vehicle.cpp.

References getVehicle(), and MSVehicle::getWaitingSeconds().

Referenced by TraCIServerAPI_Vehicle::processGet().

double TraCI_Vehicle::getWidth ( const std::string &  vehicleID)
static

Definition at line 624 of file TraCI_Vehicle.cpp.

References getVehicleType(), and MSVehicleType::getWidth().

bool TraCI_Vehicle::isOnInit ( const std::string &  vehicleID)
staticprivate
bool TraCI_Vehicle::isRouteValid ( const std::string &  vehicleID)
static

Definition at line 296 of file TraCI_Vehicle.cpp.

References getVehicle(), and MSBaseVehicle::hasValidRoute().

Referenced by TraCIServerAPI_Vehicle::processGet().

void TraCI_Vehicle::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

Definition at line 790 of file TraCI_Vehicle.cpp.

References getVehicle(), and UNUSED_PARAMETER.

TraCI_Vehicle& TraCI_Vehicle::operator= ( const TraCI_Vehicle src)
private

invalidated assignment operator

void TraCI_Vehicle::remove ( const std::string &  vehicleID,
char  reason = REMOVE_VAPORIZED 
)
static

Definition at line 999 of file TraCI_Vehicle.cpp.

References getVehicle(), and UNUSED_PARAMETER.

void TraCI_Vehicle::rerouteEffort ( const std::string &  vehicleID)
static
void TraCI_Vehicle::rerouteTraveltime ( const std::string &  vehicleID)
static
void TraCI_Vehicle::setActionStepLength ( const std::string &  vehicleID,
double  actionStepLength,
bool  resetActionOffset = true 
)
static
void TraCI_Vehicle::setAdaptedTraveltime ( const std::string &  vehicleID,
const std::string &  edgeID,
double  time = INVALID_DOUBLE_VALUE,
SUMOTime  begTime = 0,
SUMOTime  endTime = SUMOTime_MAX 
)
static
void TraCI_Vehicle::setColor ( const std::string &  vehicleID,
const TraCIColor col 
)
static
void TraCI_Vehicle::setEffort ( const std::string &  vehicleID,
const std::string &  edgeID,
double  effort = INVALID_DOUBLE_VALUE,
SUMOTime  begTime = 0,
SUMOTime  endTime = SUMOTime_MAX 
)
static
void TraCI_Vehicle::setEmissionClass ( const std::string &  vehicleID,
const std::string &  clazz 
)
static

Definition at line 1030 of file TraCI_Vehicle.cpp.

References getVehicle(), and UNUSED_PARAMETER.

void TraCI_Vehicle::setLine ( const std::string &  vehicleID,
const std::string &  line 
)
static
void TraCI_Vehicle::setMaxSpeed ( const std::string &  vehicleID,
double  speed 
)
static
void TraCI_Vehicle::setRoute ( const std::string &  vehicleID,
const std::vector< std::string > &  edgeIDs 
)
static
void TraCI_Vehicle::setRouteID ( const std::string &  vehicleID,
const std::string &  routeID 
)
static
void TraCI_Vehicle::setShapeClass ( const std::string &  vehicleID,
const std::string &  clazz 
)
static
void TraCI_Vehicle::setSignals ( const std::string &  vehicleID,
int  signals 
)
static
void TraCI_Vehicle::setSpeed ( const std::string &  vehicleID,
double  speed 
)
static

Definition at line 810 of file TraCI_Vehicle.cpp.

References getVehicle(), and UNUSED_PARAMETER.

void TraCI_Vehicle::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 TraCI_Vehicle::setType ( const std::string &  vehicleID,
const std::string &  typeID 
)
static
void TraCI_Vehicle::setVia ( const std::string &  vehicleID,
const std::vector< std::string > &  via 
)
static

Definition at line 1019 of file TraCI_Vehicle.cpp.

References getVehicle(), and UNUSED_PARAMETER.

void TraCI_Vehicle::slowDown ( const std::string &  vehicleID,
double  speed,
SUMOTime  duration 
)
static

The documentation for this class was generated from the following files: