Eclipse SUMO - Simulation of Urban MObility
Loading...
Searching...
No Matches
MSCriticalFollowerDistanceInfo Class Reference

#include <MSLeaderInfo.h>

Inheritance diagram for MSCriticalFollowerDistanceInfo:
[legend]
Collaboration diagram for MSCriticalFollowerDistanceInfo:
[legend]

Public Member Functions

int addFollower (const MSVehicle *veh, const MSVehicle *ego, double gap, double latOffset=0, int sublane=-1)
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 addLeaders (MSLeaderDistanceInfo &other)
 updatd empty sublanes with vehicles and gaps from other
void clear ()
 discard all information
void fixOppositeGaps (bool isFollower)
 subtract vehicle length from all gaps if the leader vehicle is driving in the opposite direction
CLeaderDist getClosest () const
 return vehicle with the smalles gap
const std::vector< double > & getDistances () const
double getMinDistToStopped () const
 return minimum distance to a stopped vehicle or max double
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
bool hasVehicle (const MSVehicle *veh) const
 whether the given vehicle is part of this leaderInfo
bool hasVehicles () const
void moveSamePosTo (const MSVehicle *ego, MSLeaderDistanceInfo &other)
 MSCriticalFollowerDistanceInfo (const double laneWidth, const MSVehicle *ego, const double latOffset, const bool haveOppositeLeaders=false)
 Constructor.
int numFreeSublanes () const
int numSublanes () const
CLeaderDist operator[] (int sublane) const
 return the vehicle and its distance for the given sublane
void patchGaps (double amount)
 add given value to all gaps
void removeOpposite (const MSLane *lane)
 remove vehicles that are driving in the opposite direction (fully or partially) on the given lane
void setSublaneOffset (int offset)
 set number of sublanes by which to shift positions
std::string toString () const
 print a debugging representation
virtual ~MSCriticalFollowerDistanceInfo ()
 Destructor.

Protected Attributes

int egoLeftMost
int egoRightMost
 borders of the ego vehicle for filtering of free sublanes
std::vector< double > myDistances
int myFreeSublanes
 the number of free sublanes
bool myHasVehicles
bool myHaveOppositeLeaders
std::vector< double > myMissingGaps
int myOffset
 an extra offset for shifting the interpretation of sublane borders (default [0,myWidth])
std::vector< const MSVehicle * > myVehicles
double myWidth
 the width of the lane to which this instance applies

Detailed Description

Definition at line 216 of file MSLeaderInfo.h.

Constructor & Destructor Documentation

◆ MSCriticalFollowerDistanceInfo()

MSCriticalFollowerDistanceInfo::MSCriticalFollowerDistanceInfo ( const double laneWidth,
const MSVehicle * ego,
const double latOffset,
const bool haveOppositeLeaders = false )

◆ ~MSCriticalFollowerDistanceInfo()

MSCriticalFollowerDistanceInfo::~MSCriticalFollowerDistanceInfo ( )
virtual

Destructor.

Definition at line 430 of file MSLeaderInfo.cpp.

Member Function Documentation

◆ addFollower()

◆ addLeader() [1/2]

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

Reimplemented from MSLeaderDistanceInfo.

Definition at line 242 of file MSLeaderInfo.h.

References TL, and UNUSED_PARAMETER.

◆ addLeader() [2/2]

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

Reimplemented from MSLeaderDistanceInfo.

Definition at line 234 of file MSLeaderInfo.h.

References TL, and UNUSED_PARAMETER.

◆ addLeaders()

void MSLeaderDistanceInfo::addLeaders ( MSLeaderDistanceInfo & other)
virtualinherited

updatd empty sublanes with vehicles and gaps from other

Definition at line 299 of file MSLeaderInfo.cpp.

References addLeader(), MIN2(), MSLeaderDistanceInfo(), and MSLeaderInfo::numSublanes().

Referenced by MSLaneChangerSublane::checkChangeSublane().

Here is the caller graph for this function:

◆ clear()

void MSCriticalFollowerDistanceInfo::clear ( )
virtual

discard all information

Reimplemented from MSLeaderDistanceInfo.

Definition at line 511 of file MSLeaderInfo.cpp.

References MSLeaderDistanceInfo::clear(), myMissingGaps, and MSLeaderInfo::myVehicles.

◆ fixOppositeGaps()

void MSLeaderDistanceInfo::fixOppositeGaps ( bool isFollower)
inherited

subtract vehicle length from all gaps if the leader vehicle is driving in the opposite direction

Definition at line 347 of file MSLeaderInfo.cpp.

References myDistances, and MSLeaderInfo::myVehicles.

Referenced by MSLaneChangerSublane::checkChangeOpposite(), LIBSUMO_NAMESPACE::Vehicle::getNeighbors(), and MSVehicle::planMoveInternal().

Here is the caller graph for this function:

◆ getClosest()

CLeaderDist MSLeaderDistanceInfo::getClosest ( ) const
inherited

return vehicle with the smalles gap

Definition at line 372 of file MSLeaderInfo.cpp.

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

Referenced by MSLane::getFollower().

Here is the caller graph for this function:

◆ getDistances()

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

Definition at line 187 of file MSLeaderInfo.h.

References myDistances.

◆ getMinDistToStopped()

double MSLeaderDistanceInfo::getMinDistToStopped ( ) const
inherited

return minimum distance to a stopped vehicle or max double

Definition at line 404 of file MSLeaderInfo.cpp.

References MIN2(), myDistances, MSLeaderInfo::myHasVehicles, and MSLeaderInfo::myVehicles.

Referenced by MSLCM_SL2015::mustOvertakeStopped().

Here is the caller graph for this function:

◆ getSublaneBorders()

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

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
inlineinherited

Definition at line 102 of file MSLeaderInfo.h.

References myOffset.

Referenced by MSVehicle::adaptToLeaders().

Here is the caller graph for this function:

◆ getSubLanes()

◆ getVehicles()

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

Definition at line 98 of file MSLeaderInfo.h.

References myVehicles.

◆ hasStoppedVehicle()

bool MSLeaderInfo::hasStoppedVehicle ( ) const
inherited

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:

◆ hasVehicle()

bool MSLeaderInfo::hasVehicle ( const MSVehicle * veh) const
inherited

whether the given vehicle is part of this leaderInfo

Definition at line 208 of file MSLeaderInfo.cpp.

References myHasVehicles, and myVehicles.

◆ hasVehicles()

bool MSLeaderInfo::hasVehicles ( ) const
inlineinherited

◆ moveSamePosTo()

void MSLeaderDistanceInfo::moveSamePosTo ( const MSVehicle * ego,
MSLeaderDistanceInfo & other )
inherited

Definition at line 389 of file MSLeaderInfo.cpp.

References MSLane::getEdge(), MSVehicle::getLane(), MSVehicle::getPositionOnLane(), MSLeaderDistanceInfo(), myDistances, and MSLeaderInfo::myVehicles.

Referenced by MSLaneChangerSublane::checkChangeSublane().

Here is the caller graph for this function:

◆ numFreeSublanes()

int MSLeaderInfo::numFreeSublanes ( ) const
inlineinherited

Definition at line 90 of file MSLeaderInfo.h.

References myFreeSublanes.

Referenced by MSLane::isInsertionSuccess().

Here is the caller graph for this function:

◆ numSublanes()

◆ operator[]()

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

return the vehicle and its distance for the given sublane

Definition at line 319 of file MSLeaderInfo.cpp.

References myDistances, and MSLeaderInfo::myVehicles.

◆ patchGaps()

void MSLeaderDistanceInfo::patchGaps ( double amount)
inherited

add given value to all gaps

Definition at line 363 of file MSLeaderInfo.cpp.

References myDistances, and MSLeaderInfo::myVehicles.

Referenced by MSLaneChangerSublane::checkChangeOpposite().

Here is the caller graph for this function:

◆ removeOpposite()

void MSLeaderInfo::removeOpposite ( const MSLane * lane)
inherited

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

Definition at line 221 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)
inherited

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(), and MSVehicle::planMoveInternal().

Here is the caller graph for this function:

◆ toString()

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

print a debugging representation

Reimplemented from MSLeaderDistanceInfo.

Definition at line 518 of file MSLeaderInfo.cpp.

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

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

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

◆ myDistances

◆ myFreeSublanes

◆ myHasVehicles

◆ myHaveOppositeLeaders

bool MSCriticalFollowerDistanceInfo::myHaveOppositeLeaders
protected

Definition at line 261 of file MSLeaderInfo.h.

Referenced by addFollower(), and MSCriticalFollowerDistanceInfo().

◆ myMissingGaps

std::vector<double> MSCriticalFollowerDistanceInfo::myMissingGaps
protected

Definition at line 258 of file MSLeaderInfo.h.

Referenced by addFollower(), clear(), MSCriticalFollowerDistanceInfo(), and toString().

◆ myOffset

int MSLeaderInfo::myOffset
protectedinherited

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

Definition at line 128 of file MSLeaderInfo.h.

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

◆ myVehicles

◆ myWidth

double MSLeaderInfo::myWidth
protectedinherited

the width of the lane to which this instance applies

Definition at line 125 of file MSLeaderInfo.h.

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


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