Eclipse SUMO - Simulation of Urban MObility
MSLeaderInfo Class Reference

#include <MSLeaderInfo.h>

Inheritance diagram for MSLeaderInfo:
Collaboration diagram for MSLeaderInfo:

Public Member Functions

virtual int addLeader (const MSVehicle *veh, bool beyond, double latOffset=0)
 
virtual void clear ()
 discard all information More...
 
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
 
 MSLeaderInfo (const MSLane *lane, const MSVehicle *ego=0, double latOffset=0)
 Constructor. More...
 
int numFreeSublanes () const
 
int numSublanes () const
 
const MSVehicleoperator[] (int sublane) const
 return the vehicle for the given sublane More...
 
virtual std::string toString () const
 print a debugging representation More...
 
virtual ~MSLeaderInfo ()
 Destructor. More...
 

Protected Attributes

int egoLeftMost
 
int egoRightMost
 borders of the ego vehicle for filtering of free sublanes More...
 
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

Definition at line 50 of file MSLeaderInfo.h.

Constructor & Destructor Documentation

◆ MSLeaderInfo()

MSLeaderInfo::MSLeaderInfo ( const MSLane lane,
const MSVehicle ego = 0,
double  latOffset = 0 
)

Constructor.

Definition at line 43 of file MSLeaderInfo.cpp.

References egoLeftMost, egoRightMost, getSubLanes(), myFreeSublanes, and myVehicles.

◆ ~MSLeaderInfo()

MSLeaderInfo::~MSLeaderInfo ( )
virtual

Destructor.

Definition at line 59 of file MSLeaderInfo.cpp.

Member Function Documentation

◆ addLeader()

◆ clear()

void MSLeaderInfo::clear ( )
virtual

discard all information

Reimplemented in MSCriticalFollowerDistanceInfo, and MSLeaderDistanceInfo.

Definition at line 95 of file MSLeaderInfo.cpp.

References egoLeftMost, egoRightMost, myFreeSublanes, and myVehicles.

Referenced by MSLeaderDistanceInfo::clear(), and MSVehicle::planMoveInternal().

◆ getSublaneBorders()

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

◆ getSubLanes()

◆ getVehicles()

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

Definition at line 100 of file MSLeaderInfo.h.

References myVehicles.

◆ hasStoppedVehicle()

bool MSLeaderInfo::hasStoppedVehicle ( ) const

whether a stopped vehicle is leader

Definition at line 180 of file MSLeaderInfo.cpp.

References myHasVehicles, and myVehicles.

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

◆ hasVehicles()

bool MSLeaderInfo::hasVehicles ( ) const
inline

◆ numFreeSublanes()

int MSLeaderInfo::numFreeSublanes ( ) const
inline

◆ numSublanes()

◆ operator[]()

const MSVehicle * MSLeaderInfo::operator[] ( int  sublane) const

return the vehicle for the given sublane

Definition at line 156 of file MSLeaderInfo.cpp.

References myVehicles.

◆ toString()

Field Documentation

◆ egoLeftMost

int MSLeaderInfo::egoLeftMost
protected

◆ egoRightMost

int MSLeaderInfo::egoRightMost
protected

borders of the ego vehicle for filtering of free sublanes

Definition at line 124 of file MSLeaderInfo.h.

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

◆ myFreeSublanes

◆ myHasVehicles

◆ myVehicles

◆ myWidth

double MSLeaderInfo::myWidth
protected

the width of the lane to which this instance applies

Definition at line 114 of file MSLeaderInfo.h.

Referenced by getSublaneBorders(), and getSubLanes().


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