Eclipse SUMO - Simulation of Urban MObility
MSLeaderDistanceInfo Class Reference

saves leader/follower vehicles and their distances relative to an ego vehicle More...

#include <MSLeaderInfo.h>

Inheritance diagram for MSLeaderDistanceInfo:
Collaboration diagram for MSLeaderDistanceInfo:

Public Member Functions

virtual int addLeader (const MSVehicle *veh, bool beyond, double latOffset=0)
 
virtual int addLeader (const MSVehicle *veh, double gap, double latOffset=0, int sublane=-1)
 
virtual void clear ()
 discard all information More...
 
const std::vector< double > & getDistances () const
 
void getSublaneBorders (int sublane, double latOffset, double &rightSide, double &leftSide) const
 
void getSubLanes (const MSVehicle *veh, double latOffset, int &rightmost, int &leftmost) const
 
const std::vector< const MSVehicle * > & getVehicles () const
 
bool hasStoppedVehicle () const
 whether a stopped vehicle is leader More...
 
bool hasVehicles () const
 
 MSLeaderDistanceInfo (const CLeaderDist &cLeaderDist, const MSLane *dummy)
 Construct for the non-sublane-case. More...
 
 MSLeaderDistanceInfo (const MSLane *lane, const MSVehicle *ego, double latOffset)
 Constructor. More...
 
int numFreeSublanes () const
 
int numSublanes () const
 
CLeaderDist operator[] (int sublane) const
 return the vehicle and its distance for the given sublane More...
 
virtual std::string toString () const
 print a debugging representation More...
 
virtual ~MSLeaderDistanceInfo ()
 Destructor. More...
 

Protected Attributes

int egoLeftMost
 
int egoRightMost
 borders of the ego vehicle for filtering of free sublanes More...
 
std::vector< double > myDistances
 
int myFreeSublanes
 the number of free sublanes More...
 
bool myHasVehicles
 
std::vector< const MSVehicle * > myVehicles
 
double myWidth
 the width of the lane to which this instance applies More...
 

Detailed Description

saves leader/follower vehicles and their distances relative to an ego vehicle

Definition at line 132 of file MSLeaderInfo.h.

Constructor & Destructor Documentation

◆ MSLeaderDistanceInfo() [1/2]

MSLeaderDistanceInfo::MSLeaderDistanceInfo ( const MSLane lane,
const MSVehicle ego,
double  latOffset 
)

Constructor.

Definition at line 196 of file MSLeaderInfo.cpp.

◆ MSLeaderDistanceInfo() [2/2]

MSLeaderDistanceInfo::MSLeaderDistanceInfo ( const CLeaderDist cLeaderDist,
const MSLane dummy 
)

Construct for the non-sublane-case.

Definition at line 202 of file MSLeaderInfo.cpp.

References MSLeaderInfo::myHasVehicles, and MSLeaderInfo::myVehicles.

◆ ~MSLeaderDistanceInfo()

MSLeaderDistanceInfo::~MSLeaderDistanceInfo ( )
virtual

Destructor.

Definition at line 210 of file MSLeaderInfo.cpp.

Member Function Documentation

◆ addLeader() [1/2]

virtual int MSLeaderDistanceInfo::addLeader ( const MSVehicle veh,
bool  beyond,
double  latOffset = 0 
)
inlinevirtual

Reimplemented from MSLeaderInfo.

Reimplemented in MSCriticalFollowerDistanceInfo.

Definition at line 153 of file MSLeaderInfo.h.

References UNUSED_PARAMETER.

◆ addLeader() [2/2]

int MSLeaderDistanceInfo::addLeader ( const MSVehicle veh,
double  gap,
double  latOffset = 0,
int  sublane = -1 
)
virtual

◆ clear()

void MSLeaderDistanceInfo::clear ( )
virtual

discard all information

Reimplemented from MSLeaderInfo.

Reimplemented in MSCriticalFollowerDistanceInfo.

Definition at line 255 of file MSLeaderInfo.cpp.

References MSLeaderInfo::clear(), myDistances, and MSLeaderInfo::myVehicles.

Referenced by MSCriticalFollowerDistanceInfo::clear().

◆ getDistances()

const std::vector<double>& MSLeaderDistanceInfo::getDistances ( ) const
inline

Definition at line 169 of file MSLeaderInfo.h.

References myDistances.

◆ getSublaneBorders()

void MSLeaderInfo::getSublaneBorders ( int  sublane,
double  latOffset,
double &  rightSide,
double &  leftSide 
) const
inherited

◆ getSubLanes()

◆ getVehicles()

const std::vector<const MSVehicle*>& MSLeaderInfo::getVehicles ( ) const
inlineinherited

Definition at line 99 of file MSLeaderInfo.h.

References MSLeaderInfo::myVehicles.

◆ hasStoppedVehicle()

bool MSLeaderInfo::hasStoppedVehicle ( ) const
inherited

whether a stopped vehicle is leader

Definition at line 179 of file MSLeaderInfo.cpp.

References MSLeaderInfo::myHasVehicles, and MSLeaderInfo::myVehicles.

Referenced by MSLCM_SL2015::_wantsChangeSublane(), and MSLCM_SL2015::checkStrategicChange().

◆ hasVehicles()

bool MSLeaderInfo::hasVehicles ( ) const
inlineinherited

◆ numFreeSublanes()

int MSLeaderInfo::numFreeSublanes ( ) const
inlineinherited

◆ numSublanes()

◆ operator[]()

CLeaderDist MSLeaderDistanceInfo::operator[] ( int  sublane) const

return the vehicle and its distance for the given sublane

Definition at line 262 of file MSLeaderInfo.cpp.

References myDistances, and MSLeaderInfo::myVehicles.

◆ toString()

std::string MSLeaderDistanceInfo::toString ( ) const
virtual

Field Documentation

◆ egoLeftMost

int MSLeaderInfo::egoLeftMost
protectedinherited

◆ egoRightMost

int MSLeaderInfo::egoRightMost
protectedinherited

borders of the ego vehicle for filtering of free sublanes

Definition at line 123 of file MSLeaderInfo.h.

Referenced by MSCriticalFollowerDistanceInfo::addFollower(), MSLeaderInfo::addLeader(), addLeader(), MSLeaderInfo::clear(), and MSLeaderInfo::MSLeaderInfo().

◆ myDistances

std::vector<double> MSLeaderDistanceInfo::myDistances
protected

◆ myFreeSublanes

◆ myHasVehicles

◆ myVehicles

◆ myWidth

double MSLeaderInfo::myWidth
protectedinherited

the width of the lane to which this instance applies

Definition at line 113 of file MSLeaderInfo.h.

Referenced by MSLeaderInfo::getSublaneBorders(), and MSLeaderInfo::getSubLanes().


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