SUMO - Simulation of Urban MObility
libsumo::Vehicle Class Reference

#include <Vehicle.h>

Collaboration diagram for libsumo::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", int depart=DEPARTFLAG_NOW, int departLane=DEPARTFLAG_LANE_FIRST_ALLOWED, double departPos=DEPARTFLAG_POS_BASE, double departSpeed=0, int arrivalLane=ARRIVALFLAG_LANE_CURRENT, double arrivalPos=ARRIVALFLAG_POS_MAX, double arrivalSpeed=ARRIVALFLAG_SPEED_CURRENT, const std::string &fromTaz="", const std::string &toTaz="", const std::string &line="", int personCapacity=4, 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, double begSeconds=0, double endSeconds=std::numeric_limits< double >::max())
 
static void setEffort (const std::string &vehicleID, const std::string &edgeID, double effort=INVALID_DOUBLE_VALUE, double begSeconds=0, double endSeconds=std::numeric_limits< double >::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 laneIndex, const double x, const double y, double angle, const int keepRouteFlag)
 
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

Vehicleoperator= (const Vehicle &src)
 invalidated assignment operator More...
 
 Vehicle ()
 invalidated standard constructor More...
 
 Vehicle (const 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

Definition at line 53 of file Vehicle.h.

Constructor & Destructor Documentation

◆ Vehicle() [1/2]

libsumo::Vehicle::Vehicle ( )
private

invalidated standard constructor

◆ Vehicle() [2/2]

libsumo::Vehicle::Vehicle ( const Vehicle src)
private

invalidated copy constructor

Member Function Documentation

◆ add()

◆ changeLane()

void Vehicle::changeLane ( const std::string &  vehicleID,
int  laneIndex,
SUMOTime  duration 
)
static

◆ changeSublane()

void Vehicle::changeSublane ( const std::string &  vehicleID,
double  latDist 
)
static

◆ changeTarget()

◆ getAccel()

double Vehicle::getAccel ( const std::string &  vehicleID)
static

Definition at line 563 of file Vehicle.cpp.

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

◆ getAccumulatedWaitingTime()

double Vehicle::getAccumulatedWaitingTime ( const std::string &  vehicleID)
static

◆ getActionStepLength()

double Vehicle::getActionStepLength ( const std::string &  vehicleID)
static

Definition at line 580 of file Vehicle.cpp.

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

◆ getAdaptedTraveltime()

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

◆ getAllowedSpeed()

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

◆ getAngle()

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

◆ getApparentDecel()

double Vehicle::getApparentDecel ( const std::string &  vehicleID)
static

◆ getBestLanes()

◆ getCO2Emission()

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

◆ getCOEmission()

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

◆ getColor()

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

◆ getDecel()

double Vehicle::getDecel ( const std::string &  vehicleID)
static

◆ getDistance()

◆ getDrivingDistance()

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

◆ getDrivingDistance2D()

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

◆ getEdges()

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

◆ getEffort()

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

◆ getElectricityConsumption()

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

◆ getEmergencyDecel()

double Vehicle::getEmergencyDecel ( const std::string &  vehicleID)
static

◆ getEmissionClass()

std::string Vehicle::getEmissionClass ( const std::string &  vehicleID)
static

Definition at line 546 of file Vehicle.cpp.

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

◆ getFuelConsumption()

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

◆ getHCEmission()

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

◆ getIDCount()

int Vehicle::getIDCount ( )
static

Definition at line 95 of file Vehicle.cpp.

References getIDList().

Referenced by TraCIServerAPI_Vehicle::processGet().

◆ getIDList()

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

◆ getImperfection()

double Vehicle::getImperfection ( const std::string &  vehicleID)
static

◆ getLanechangeMode()

int Vehicle::getLanechangeMode ( const std::string &  vehicleID)
static

◆ getLaneChangeState()

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

◆ getLaneID()

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

◆ getLaneIndex()

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

◆ getLanePosition()

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

◆ getLastActionTime()

double Vehicle::getLastActionTime ( const std::string &  vehicleID)
static

Definition at line 583 of file Vehicle.cpp.

References getVehicle(), and STEPS2TIME.

Referenced by TraCIServerAPI_Vehicle::processGet().

◆ getLateralLanePosition()

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

◆ getLeader()

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

◆ getLength()

double Vehicle::getLength ( const std::string &  vehicleID)
static

Definition at line 557 of file Vehicle.cpp.

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

Referenced by getDistance().

◆ getLine()

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

◆ getMaxSpeed()

double Vehicle::getMaxSpeed ( const std::string &  vehicleID)
static

Definition at line 618 of file Vehicle.cpp.

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

◆ getMinGap()

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

Definition at line 612 of file Vehicle.cpp.

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

◆ getNextTLS()

◆ getNoiseEmission()

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

◆ getNOxEmission()

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

◆ getParameter()

◆ getPersonNumber()

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

Definition at line 244 of file Vehicle.cpp.

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

Referenced by TraCIServerAPI_Vehicle::processGet().

◆ getPMxEmission()

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

◆ getPosition()

◆ getPosition3D()

static TraCIPosition libsumo::Vehicle::getPosition3D ( const std::string &  vehicleID)
static

◆ getRoadID()

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

◆ getRouteID()

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

Definition at line 168 of file Vehicle.cpp.

References Named::getID(), MSBaseVehicle::getRoute(), and getVehicle().

Referenced by TraCIServerAPI_Vehicle::processGet().

◆ getRouteIndex()

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

◆ getRoutingMode()

int Vehicle::getRoutingMode ( const std::string &  vehicleID)
static

◆ getShapeClass()

std::string Vehicle::getShapeClass ( const std::string &  vehicleID)
static

Definition at line 551 of file Vehicle.cpp.

References getVehicleShapeName(), and getVehicleType().

◆ getSignalStates()

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

Definition at line 314 of file Vehicle.cpp.

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

Referenced by TraCIServerAPI_Vehicle::processGet().

◆ getSlope()

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

◆ getSpeed()

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

◆ getSpeedDeviation()

double Vehicle::getSpeedDeviation ( const std::string &  vehicleID)
static

◆ getSpeedFactor()

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

Definition at line 465 of file Vehicle.cpp.

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

Referenced by TraCIServerAPI_Vehicle::processGet().

◆ getSpeedMode()

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

◆ getSpeedWithoutTraCI()

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

◆ getStopState()

◆ getTau()

double Vehicle::getTau ( const std::string &  vehicleID)
static

◆ getTypeID()

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

◆ getVClass()

std::string Vehicle::getVClass ( const std::string &  vehicleID)
static

Definition at line 606 of file Vehicle.cpp.

References getVehicleType(), and toString().

◆ getVehicle()

◆ getVehicleType()

◆ getVia()

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

◆ getWaitingTime()

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

Definition at line 264 of file Vehicle.cpp.

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

Referenced by TraCIServerAPI_Vehicle::processGet().

◆ getWidth()

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

Definition at line 624 of file Vehicle.cpp.

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

◆ isOnInit()

bool Vehicle::isOnInit ( const std::string &  vehicleID)
staticprivate

◆ isRouteValid()

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

Definition at line 296 of file Vehicle.cpp.

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

Referenced by TraCIServerAPI_Vehicle::processGet().

◆ isVisible()

◆ moveTo()

◆ moveToXY()

◆ operator=()

Vehicle& libsumo::Vehicle::operator= ( const Vehicle src)
private

invalidated assignment operator

◆ remove()

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

Definition at line 1144 of file Vehicle.cpp.

References getVehicle(), and UNUSED_PARAMETER.

◆ rerouteEffort()

void Vehicle::rerouteEffort ( const std::string &  vehicleID)
static

◆ rerouteTraveltime()

void Vehicle::rerouteTraveltime ( const std::string &  vehicleID)
static

◆ resume()

◆ setActionStepLength()

void Vehicle::setActionStepLength ( const std::string &  vehicleID,
double  actionStepLength,
bool  resetActionOffset = true 
)
static

◆ setAdaptedTraveltime()

void Vehicle::setAdaptedTraveltime ( const std::string &  vehicleID,
const std::string &  edgeID,
double  time = INVALID_DOUBLE_VALUE,
double  begSeconds = 0,
double  endSeconds = std::numeric_limits<double>::max() 
)
static

◆ setColor()

◆ setEffort()

void Vehicle::setEffort ( const std::string &  vehicleID,
const std::string &  edgeID,
double  effort = INVALID_DOUBLE_VALUE,
double  begSeconds = 0,
double  endSeconds = std::numeric_limits<double>::max() 
)
static

◆ setEmissionClass()

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

Definition at line 1175 of file Vehicle.cpp.

References getVehicle(), and UNUSED_PARAMETER.

◆ setLine()

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

◆ setMaxSpeed()

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

◆ setParameter()

◆ setRoute()

void Vehicle::setRoute ( const std::string &  vehicleID,
const std::vector< std::string > &  edgeIDs 
)
static

◆ setRouteID()

void Vehicle::setRouteID ( const std::string &  vehicleID,
const std::string &  routeID 
)
static

◆ setShapeClass()

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

◆ setSignals()

void Vehicle::setSignals ( const std::string &  vehicleID,
int  signals 
)
static

◆ setSpeed()

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

Definition at line 955 of file Vehicle.cpp.

References getVehicle(), and UNUSED_PARAMETER.

◆ setStop()

void 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

◆ setType()

void Vehicle::setType ( const std::string &  vehicleID,
const std::string &  typeID 
)
static

◆ setVia()

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

Definition at line 1164 of file Vehicle.cpp.

References getVehicle(), and UNUSED_PARAMETER.

◆ slowDown()

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

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