Eclipse SUMO - Simulation of Urban MObility
MSVehicle::State Class Reference

Container that holds the vehicles driving state (position+speed). More...

#include <MSVehicle.h>

Collaboration diagram for MSVehicle::State:

Public Member Functions

double backPos () const
 back Position of this state More...
 
double lastCoveredDist () const
 previous Speed of this state More...
 
bool operator!= (const State &state)
 Operator !=. More...
 
Stateoperator= (const State &state)
 Assignment operator. More...
 
double pos () const
 Position of this state. More...
 
double posLat () const
 Lateral Position of this state (m relative to the centerline of the lane). More...
 
double speed () const
 Speed of this state. More...
 
 State (const State &state)
 Copy constructor. More...
 
 State (double pos, double speed, double posLat, double backPos)
 Constructor. More...
 

Private Attributes

double myBackPos
 the stored back position More...
 
double myLastCoveredDist
 
double myPos
 the stored position More...
 
double myPosLat
 the stored lateral position More...
 
double myPreviousSpeed
 the speed at the begin of the previous time step More...
 
double mySpeed
 the stored speed (should be >=0 at any time) More...
 

Friends

class MSLaneChanger
 
class MSLaneChangerSublane
 
class MSVehicle
 vehicle sets states directly More...
 

Detailed Description

Container that holds the vehicles driving state (position+speed).

Definition at line 90 of file MSVehicle.h.

Constructor & Destructor Documentation

◆ State() [1/2]

MSVehicle::State::State ( double  pos,
double  speed,
double  posLat,
double  backPos 
)

Constructor.

Definition at line 167 of file MSVehicle.cpp.

◆ State() [2/2]

MSVehicle::State::State ( const State state)

Copy constructor.

Definition at line 134 of file MSVehicle.cpp.

References myBackPos, myLastCoveredDist, myPos, myPosLat, myPreviousSpeed, and mySpeed.

Member Function Documentation

◆ backPos()

double MSVehicle::State::backPos ( ) const
inline

back Position of this state

Definition at line 125 of file MSVehicle.h.

References myBackPos.

◆ lastCoveredDist()

double MSVehicle::State::lastCoveredDist ( ) const
inline

previous Speed of this state

Definition at line 130 of file MSVehicle.h.

References myLastCoveredDist.

Referenced by MSVehicle::getLastStepDist().

◆ operator!=()

bool MSVehicle::State::operator!= ( const State state)

Operator !=.

Definition at line 157 of file MSVehicle.cpp.

References myBackPos, myLastCoveredDist, myPos, myPosLat, myPreviousSpeed, and mySpeed.

◆ operator=()

MSVehicle::State & MSVehicle::State::operator= ( const State state)

Assignment operator.

Definition at line 145 of file MSVehicle.cpp.

References myBackPos, myLastCoveredDist, myPos, myPosLat, myPreviousSpeed, and mySpeed.

◆ pos()

double MSVehicle::State::pos ( ) const
inline

Position of this state.

Definition at line 110 of file MSVehicle.h.

References myPos.

Referenced by GUIVehicle::drawAction_drawCarriageClass(), and MSVehicle::processNextStop().

◆ posLat()

double MSVehicle::State::posLat ( ) const
inline

Lateral Position of this state (m relative to the centerline of the lane).

Definition at line 120 of file MSVehicle.h.

References myPosLat.

◆ speed()

Friends And Related Function Documentation

◆ MSLaneChanger

friend class MSLaneChanger
friend

Definition at line 93 of file MSVehicle.h.

◆ MSLaneChangerSublane

friend class MSLaneChangerSublane
friend

Definition at line 94 of file MSVehicle.h.

◆ MSVehicle

friend class MSVehicle
friend

vehicle sets states directly

Definition at line 92 of file MSVehicle.h.

Field Documentation

◆ myBackPos

double MSVehicle::State::myBackPos
private

◆ myLastCoveredDist

double MSVehicle::State::myLastCoveredDist
private

the distance covered in the last timestep NOTE: In case of ballistic positional update, this is not necessarily given by myPos - SPEED2DIST(mySpeed + myPreviousSpeed)/2, because a stop may have occurred within the last step.

Definition at line 157 of file MSVehicle.h.

Referenced by MSVehicle::executeMove(), lastCoveredDist(), operator!=(), operator=(), State(), and MSVehicle::updateState().

◆ myPos

◆ myPosLat

◆ myPreviousSpeed

double MSVehicle::State::myPreviousSpeed
private

the speed at the begin of the previous time step

Definition at line 151 of file MSVehicle.h.

Referenced by MSVehicle::getPreviousSpeed(), operator!=(), operator=(), MSVehicle::Influencer::postProcessRemoteControl(), State(), and MSVehicle::updateState().

◆ mySpeed


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