Eclipse SUMO - Simulation of Urban MObility
MSLeaderInfo Class Reference

#include <MSLeaderInfo.h>

Inheritance diagram for MSLeaderInfo:
[legend]

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
 
int getSublaneOffset () 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 double laneWidth, const MSVehicle *ego=nullptr, const double latOffset=0.)
 Constructor. More...
 
int numFreeSublanes () const
 
int numSublanes () const
 
const MSVehicleoperator[] (int sublane) const
 return the vehicle for the given sublane More...
 
void removeOpposite (const MSLane *lane)
 remove vehicles that are driving in the opposite direction (fully or partially) on the given lane More...
 
void setSublaneOffset (int offset)
 set number of sublanes by which to shift positions 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
 
int myOffset
 an extra offset for shifting the interpretation of sublane borders (default [0,myWidth]) More...
 
std::vector< const MSVehicle * > myVehicles
 
double myWidth
 the width of the lane to which this instance applies More...
 

Detailed Description

Definition at line 48 of file MSLeaderInfo.h.

Constructor & Destructor Documentation

◆ MSLeaderInfo()

MSLeaderInfo::MSLeaderInfo ( const double  laneWidth,
const MSVehicle ego = nullptr,
const double  latOffset = 0. 
)

Constructor.

Definition at line 37 of file MSLeaderInfo.cpp.

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

◆ ~MSLeaderInfo()

MSLeaderInfo::~MSLeaderInfo ( )
virtual

Destructor.

Definition at line 54 of file MSLeaderInfo.cpp.

Member Function Documentation

◆ addLeader()

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

Reimplemented in MSCriticalFollowerDistanceInfo, and MSLeaderDistanceInfo.

Definition at line 58 of file MSLeaderInfo.cpp.

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

Referenced by MSVehicle::checkLinkLeader(), MSLane::getFirstVehicleInformation(), MSLane::getLastVehicleInformation(), MSLane::getPartialBeyond(), MSVehicle::planMoveInternal(), MSLane::planMovements(), and MSLane::updateLeaderInfo().

Here is the caller graph for this function:

◆ clear()

void MSLeaderInfo::clear ( )
virtual

discard all information

Reimplemented in MSCriticalFollowerDistanceInfo, and MSLeaderDistanceInfo.

Definition at line 93 of file MSLeaderInfo.cpp.

References egoLeftMost, egoRightMost, myFreeSublanes, and myVehicles.

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

Here is the caller graph for this function:

◆ getSublaneBorders()

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

Definition at line 153 of file MSLeaderInfo.cpp.

References MSGlobals::gLateralResolution, MIN2(), myOffset, myVehicles, and myWidth.

Referenced by MSLCM_SL2015::checkBlockingVehicles(), MSLCM_SL2015::commitFollowSpeed(), MSLCM_SL2015::updateCFRelated(), MSLCM_SL2015::updateExpectedSublaneSpeeds(), and MSLCM_SL2015::updateGaps().

Here is the caller graph for this function:

◆ getSublaneOffset()

int MSLeaderInfo::getSublaneOffset ( ) const
inline

Definition at line 102 of file MSLeaderInfo.h.

References myOffset.

Referenced by MSVehicle::adaptToLeaders(), and MSLane::getFollowersOnConsecutive().

Here is the caller graph for this function:

◆ getSubLanes()

◆ getVehicles()

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

Definition at line 98 of file MSLeaderInfo.h.

References myVehicles.

◆ hasStoppedVehicle()

bool MSLeaderInfo::hasStoppedVehicle ( ) const

whether a stopped vehicle is leader

Definition at line 194 of file MSLeaderInfo.cpp.

References myHasVehicles, and myVehicles.

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

Here is the caller graph for this function:

◆ hasVehicles()

bool MSLeaderInfo::hasVehicles ( ) const
inline

◆ numFreeSublanes()

int MSLeaderInfo::numFreeSublanes ( ) const
inline

Definition at line 90 of file MSLeaderInfo.h.

References myFreeSublanes.

Referenced by MSLane::addLeaders(), MSLane::getFollowersOnConsecutive(), MSLane::getLeadersOnConsecutive(), and MSLane::isInsertionSuccess().

Here is the caller graph for this function:

◆ numSublanes()

◆ operator[]()

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

return the vehicle for the given sublane

Definition at line 163 of file MSLeaderInfo.cpp.

References myVehicles.

◆ removeOpposite()

void MSLeaderInfo::removeOpposite ( const MSLane lane)

remove vehicles that are driving in the opposite direction (fully or partially) on the given lane

Definition at line 207 of file MSLeaderInfo.cpp.

References MSLane::getEdge(), MSVehicle::getLane(), MSVehicle::getLaneChangeModel(), MSAbstractLaneChangeModel::isOpposite(), and myVehicles.

Referenced by MSVehicle::planMoveInternal().

Here is the caller graph for this function:

◆ setSublaneOffset()

void MSLeaderInfo::setSublaneOffset ( int  offset)

set number of sublanes by which to shift positions

Definition at line 187 of file MSLeaderInfo.cpp.

References MSGlobals::gLateralResolution, and myOffset.

Referenced by MSLaneChangerSublane::addOutsideLeaders(), MSLane::getFollowersOnConsecutive(), MSLaneChangerSublane::getLeaders(), and MSVehicle::planMoveInternal().

Here is the caller graph for this function:

◆ toString()

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

print a debugging representation

Reimplemented in MSCriticalFollowerDistanceInfo, and MSLeaderDistanceInfo.

Definition at line 171 of file MSLeaderInfo.cpp.

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

Referenced by MSVehicle::adaptToLeaders(), MSVehicle::checkLinkLeader(), MSLane::getFollowersOnConsecutive(), MSLane::getLastVehicleInformation(), MSLane::getLeadersOnConsecutive(), MSLane::isInsertionSuccess(), MSVehicle::planMoveInternal(), and MSLane::planMovements().

Here is the caller graph for this function:

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 135 of file MSLeaderInfo.h.

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

◆ myFreeSublanes

◆ myHasVehicles

◆ myOffset

int MSLeaderInfo::myOffset
protected

an extra offset for shifting the interpretation of sublane borders (default [0,myWidth])

Definition at line 125 of file MSLeaderInfo.h.

Referenced by getSublaneBorders(), getSublaneOffset(), getSubLanes(), and setSublaneOffset().

◆ myVehicles

◆ myWidth

double MSLeaderInfo::myWidth
protected

the width of the lane to which this instance applies

Definition at line 122 of file MSLeaderInfo.h.

Referenced by getSublaneBorders(), and getSubLanes().


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