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

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< BestLanesDatagetBestLanes (const std::string &vehicleID)
 
static std::vector< NextTLSDatagetNextTLS (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 MSVehicleTypegetVehicleType (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_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 isVisible (const MSVehicle *veh)
 
static bool onInit (const std::string &vehicleID)
 

Detailed Description

C++ TraCI client API implementation.

Definition at line 53 of file TraCI_Vehicle.h.

Constructor & Destructor Documentation

◆ TraCI_Vehicle() [1/2]

TraCI_Vehicle::TraCI_Vehicle ( )
private

invalidated standard constructor

◆ TraCI_Vehicle() [2/2]

TraCI_Vehicle::TraCI_Vehicle ( const TraCI_Vehicle src)
private

invalidated copy constructor

Member Function Documentation

◆ add()

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 658 of file TraCI_Vehicle.cpp.

References getVehicle().

◆ changeLane()

void TraCI_Vehicle::changeLane ( const std::string &  vehID,
int  laneIndex,
SUMOTime  duration 
)
static

Definition at line 653 of file TraCI_Vehicle.cpp.

◆ getAdaptedTraveltime()

double TraCI_Vehicle::getAdaptedTraveltime ( const std::string &  vehicleID,
const std::string &  edgeID,
int  time 
)
static

◆ getAllowedSpeed()

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

◆ getAngle()

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

◆ getBestLanes()

◆ getCO2Emission()

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

◆ getCOEmission()

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

◆ getColor()

TraCIColor TraCI_Vehicle::getColor ( const std::string &  vehicleID)
static

◆ getDistance()

◆ getDrivingDistance()

double TraCI_Vehicle::getDrivingDistance ( const std::string &  vehicleID,
const std::string &  edgeID,
double  position,
int  laneIndex 
)
static

◆ getDrivingDistance2D()

double TraCI_Vehicle::getDrivingDistance2D ( const std::string &  vehicleID,
double  x,
double  y 
)
static

◆ getEdges()

std::vector< std::string > TraCI_Vehicle::getEdges ( const std::string &  vehicleID)
static

◆ getEffort()

double TraCI_Vehicle::getEffort ( const std::string &  vehicleID,
const std::string &  edgeID,
int  time 
)
static

◆ getElectricityConsumption()

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

◆ getFuelConsumption()

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

◆ getHCEmission()

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

◆ getIDCount()

int TraCI_Vehicle::getIDCount ( )
static

Definition at line 92 of file TraCI_Vehicle.cpp.

References getIDList().

Referenced by TraCIServerAPI_Vehicle::processGet().

◆ getIDList()

std::vector< std::string > TraCI_Vehicle::getIDList ( )
static

◆ getLaneChangeState()

std::pair< int, int > TraCI_Vehicle::getLaneChangeState ( const std::string &  vehicleID,
int  direction 
)
static

◆ getLaneID()

std::string TraCI_Vehicle::getLaneID ( const std::string &  vehicleID)
static

◆ getLaneIndex()

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

◆ getLanePosition()

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

◆ getLateralLanePosition()

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

◆ getLeader()

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

◆ getLine()

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

◆ getNextTLS()

◆ getNoiseEmission()

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

◆ getNOxEmission()

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

◆ getParameter()

◆ getPersonNumber()

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

Definition at line 241 of file TraCI_Vehicle.cpp.

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

Referenced by TraCIServerAPI_Vehicle::processGet().

◆ getPMxEmission()

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

◆ getPosition()

TraCIPosition TraCI_Vehicle::getPosition ( const std::string &  vehicleID)
static

◆ getPosition3D()

static TraCIPosition TraCI_Vehicle::getPosition3D ( const std::string &  vehicleID)
static

◆ getRoadID()

std::string TraCI_Vehicle::getRoadID ( const std::string &  vehicleID)
static

◆ getRouteID()

std::string TraCI_Vehicle::getRouteID ( const std::string &  vehicleID)
static

◆ getRouteIndex()

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

◆ getSignalStates()

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

Definition at line 305 of file TraCI_Vehicle.cpp.

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

Referenced by TraCIServerAPI_Vehicle::processGet().

◆ getSlope()

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

◆ getSpeed()

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

◆ getSpeedFactor()

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

◆ getSpeedMode()

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

◆ getSpeedWithoutTraCI()

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

◆ getStopState()

◆ getTypeID()

std::string TraCI_Vehicle::getTypeID ( const std::string &  vehicleID)
static

◆ getVehicle()

◆ getVehicleType()

const MSVehicleType & TraCI_Vehicle::getVehicleType ( const std::string &  vehicleID)
static

Definition at line 510 of file TraCI_Vehicle.cpp.

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

Referenced by TraCIServerAPI_Vehicle::processGet().

◆ getVia()

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

◆ getWaitingTime()

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

Definition at line 261 of file TraCI_Vehicle.cpp.

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

Referenced by TraCIServerAPI_Vehicle::processGet().

◆ isRouteValid()

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

Definition at line 287 of file TraCI_Vehicle.cpp.

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

Referenced by TraCIServerAPI_Vehicle::processGet().

◆ isVisible()

◆ moveTo()

void TraCI_Vehicle::moveTo ( const std::string &  vehicleID,
const std::string &  laneID,
double  position 
)
static

Definition at line 680 of file TraCI_Vehicle.cpp.

◆ moveToXY()

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 684 of file TraCI_Vehicle.cpp.

◆ onInit()

bool TraCI_Vehicle::onInit ( const std::string &  vehicleID)
staticprivate

◆ operator=()

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

invalidated assignment operator

◆ remove()

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

Definition at line 700 of file TraCI_Vehicle.cpp.

◆ resume()

◆ setColor()

void TraCI_Vehicle::setColor ( const std::string &  vehicleID,
const TraCIColor c 
)
static

Definition at line 704 of file TraCI_Vehicle.cpp.

◆ setEmissionClass()

void TraCI_Vehicle::setEmissionClass ( const std::string &  vehicleID,
const std::string &  clazz 
)
static

Definition at line 720 of file TraCI_Vehicle.cpp.

◆ setLine()

void TraCI_Vehicle::setLine ( const std::string &  vehicleID,
const std::string &  line 
)
static

Definition at line 708 of file TraCI_Vehicle.cpp.

◆ setMaxSpeed()

void TraCI_Vehicle::setMaxSpeed ( const std::string &  vehicleID,
double  speed 
)
static

Definition at line 696 of file TraCI_Vehicle.cpp.

◆ setParameter()

◆ setShapeClass()

void TraCI_Vehicle::setShapeClass ( const std::string &  vehicleID,
const std::string &  clazz 
)
static

Definition at line 716 of file TraCI_Vehicle.cpp.

◆ setSpeed()

void TraCI_Vehicle::setSpeed ( const std::string &  vehicleID,
double  speed 
)
static

Definition at line 692 of file TraCI_Vehicle.cpp.

◆ setStop()

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

◆ setVia()

void TraCI_Vehicle::setVia ( const std::string &  vehicleID,
const std::vector< std::string > &  via 
)
static

Definition at line 712 of file TraCI_Vehicle.cpp.

◆ slowDown()

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

Definition at line 688 of file TraCI_Vehicle.cpp.


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