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:
Inheritance graph
Collaboration diagram for MSLeaderDistanceInfo:
Collaboration graph

Public Member Functions

virtual int addLeader (const MSVehicle *veh, SUMOReal gap, SUMOReal latOffset=0, int sublane=-1)
 
virtual int addLeader (const MSVehicle *veh, bool beyond, SUMOReal latOffset=0)
 
virtual void clear ()
 discard all information More...
 
void getSubLanes (const MSVehicle *veh, SUMOReal latOffset, int &rightmost, int &leftmost) const
 
bool hasStoppedVehicle () const
 whether a stopped vehicle is leader More...
 
bool hasVehicles () const
 
 MSLeaderDistanceInfo (const MSLane *lane, const MSVehicle *ego, SUMOReal 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< SUMORealmyDistances
 
int myFreeSublanes
 the number of free sublanes More...
 
bool myHasVehicles
 
std::vector< const MSVehicle * > myVehicles
 
SUMOReal 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 127 of file MSLeaderInfo.h.

Constructor & Destructor Documentation

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

Constructor.

Definition at line 183 of file MSLeaderInfo.cpp.

MSLeaderDistanceInfo::~MSLeaderDistanceInfo ( )
virtual

Destructor.

Definition at line 189 of file MSLeaderInfo.cpp.

Member Function Documentation

int MSLeaderDistanceInfo::addLeader ( const MSVehicle veh,
SUMOReal  gap,
SUMOReal  latOffset = 0,
int  sublane = -1 
)
virtual
virtual int MSLeaderDistanceInfo::addLeader ( const MSVehicle veh,
bool  beyond,
SUMOReal  latOffset = 0 
)
inlinevirtual
void MSLeaderDistanceInfo::clear ( )
virtual

discard all information

Reimplemented from MSLeaderInfo.

Reimplemented in MSCriticalFollowerDistanceInfo.

Definition at line 234 of file MSLeaderInfo.cpp.

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

Referenced by MSCriticalFollowerDistanceInfo::clear().

bool MSLeaderInfo::hasStoppedVehicle ( ) const
inherited
bool MSLeaderInfo::hasVehicles ( ) const
inlineinherited
int MSLeaderInfo::numFreeSublanes ( ) const
inlineinherited
CLeaderDist MSLeaderDistanceInfo::operator[] ( int  sublane) const

return the vehicle and its distance for the given sublane

Definition at line 241 of file MSLeaderInfo.cpp.

References myDistances, and MSLeaderInfo::myVehicles.

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

print a debugging representation

Reimplemented from MSLeaderInfo.

Reimplemented in MSCriticalFollowerDistanceInfo.

Definition at line 249 of file MSLeaderInfo.cpp.

References Named::getIDSecure(), myDistances, MSLeaderInfo::myFreeSublanes, and MSLeaderInfo::myVehicles.

Referenced by MSLCM_SL2015::_wantsChangeSublane(), and MSLaneChangerSublane::checkChangeSublane().

Field Documentation

int MSLeaderInfo::egoLeftMost
protectedinherited
int MSLeaderInfo::egoRightMost
protectedinherited

borders of the ego vehicle for filtering of free sublanes

Definition at line 118 of file MSLeaderInfo.h.

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

std::vector<SUMOReal> MSLeaderDistanceInfo::myDistances
protected
bool MSLeaderInfo::myHasVehicles
protectedinherited
SUMOReal MSLeaderInfo::myWidth
protectedinherited

the width of the lane to which this instance applies

Definition at line 108 of file MSLeaderInfo.h.

Referenced by MSLeaderInfo::getSubLanes().


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