![]() |
Eclipse SUMO - Simulation of Urban MObility
|
saves leader/follower vehicles and their distances relative to an ego vehicle More...
#include <MSLeaderInfo.h>
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... | |
saves leader/follower vehicles and their distances relative to an ego vehicle
Definition at line 130 of file MSLeaderInfo.h.
MSLeaderDistanceInfo::MSLeaderDistanceInfo | ( | const MSLane * | lane, |
const MSVehicle * | ego, | ||
double | latOffset | ||
) |
Constructor.
Definition at line 195 of file MSLeaderInfo.cpp.
MSLeaderDistanceInfo::MSLeaderDistanceInfo | ( | const CLeaderDist & | cLeaderDist, |
const MSLane * | dummy | ||
) |
Construct for the non-sublane-case.
Definition at line 201 of file MSLeaderInfo.cpp.
References MSLeaderInfo::myHasVehicles, and MSLeaderInfo::myVehicles.
|
virtual |
Destructor.
Definition at line 209 of file MSLeaderInfo.cpp.
|
inlinevirtual |
Reimplemented from MSLeaderInfo.
Reimplemented in MSCriticalFollowerDistanceInfo.
Definition at line 151 of file MSLeaderInfo.h.
References UNUSED_PARAMETER.
|
virtual |
Reimplemented in MSCriticalFollowerDistanceInfo.
Definition at line 213 of file MSLeaderInfo.cpp.
References MSLeaderInfo::egoLeftMost, MSLeaderInfo::egoRightMost, MSLeaderInfo::getSubLanes(), myDistances, MSLeaderInfo::myFreeSublanes, MSLeaderInfo::myHasVehicles, and MSLeaderInfo::myVehicles.
Referenced by MSLaneChangerSublane::getLeaders(), and MSLane::getLeadersOnConsecutive().
|
virtual |
discard all information
Reimplemented from MSLeaderInfo.
Reimplemented in MSCriticalFollowerDistanceInfo.
Definition at line 254 of file MSLeaderInfo.cpp.
References MSLeaderInfo::clear(), myDistances, and MSLeaderInfo::myVehicles.
Referenced by MSCriticalFollowerDistanceInfo::clear().
|
inline |
Definition at line 167 of file MSLeaderInfo.h.
References myDistances.
|
inherited |
Definition at line 144 of file MSLeaderInfo.cpp.
References MSGlobals::gLateralResolution, MIN2(), MSLeaderInfo::myVehicles, and MSLeaderInfo::myWidth.
Referenced by MSLCM_SL2015::checkBlockingVehicles(), MSLCM_SL2015::commitFollowSpeed(), MSLCM_SL2015::updateCFRelated(), MSLCM_SL2015::updateExpectedSublaneSpeeds(), and MSLCM_SL2015::updateGaps().
|
inherited |
Definition at line 104 of file MSLeaderInfo.cpp.
References DELTA_T, MSVehicle::getActionStepLength(), MSVehicle::getActionStepLengthSecs(), MSVehicle::getLaneChangeModel(), MSVehicle::getLateralPositionOnLane(), MSAbstractLaneChangeModel::getManeuverDist(), MSVehicleType::getMaxSpeedLat(), MSAbstractLaneChangeModel::getSpeedLat(), MSBaseVehicle::getVehicleType(), MSVehicleType::getWidth(), MSGlobals::gLateralResolution, MAX2(), MIN2(), MSLeaderInfo::myVehicles, and MSLeaderInfo::myWidth.
Referenced by MSVehicle::adaptToLeaders(), MSCriticalFollowerDistanceInfo::addFollower(), MSLeaderInfo::addLeader(), addLeader(), MSLeaderInfo::MSLeaderInfo(), MSAbstractLaneChangeModel::setFollowerGaps(), MSAbstractLaneChangeModel::setLeaderGaps(), and MSAbstractLaneChangeModel::setOrigLeaderGaps().
|
inlineinherited |
Definition at line 97 of file MSLeaderInfo.h.
References MSLeaderInfo::myVehicles.
|
inherited |
whether a stopped vehicle is leader
Definition at line 178 of file MSLeaderInfo.cpp.
References MSLeaderInfo::myHasVehicles, and MSLeaderInfo::myVehicles.
Referenced by MSLCM_SL2015::_wantsChangeSublane(), and MSLCM_SL2015::checkStrategicChange().
|
inlineinherited |
Definition at line 93 of file MSLeaderInfo.h.
References MSLeaderInfo::myHasVehicles.
Referenced by MSLCM_SL2015::checkStrategicChange(), MSLCM_SL2015::commitFollowSpeed(), MSLane::isInsertionSuccess(), and MSLCM_SL2015::updateGaps().
|
inlineinherited |
Definition at line 89 of file MSLeaderInfo.h.
References MSLeaderInfo::myFreeSublanes.
Referenced by MSLane::getFollowersOnConsecutive(), MSLaneChangerSublane::getLeaders(), MSLane::getLeadersOnConsecutive(), and MSLane::isInsertionSuccess().
|
inlineinherited |
Definition at line 85 of file MSLeaderInfo.h.
References MSLeaderInfo::myVehicles.
Referenced by MSLCM_SL2015::checkBlockingVehicles(), MSLCM_SL2015::commitFollowSpeed(), MSLCM_SL2015::computeSublaneShift(), MSLane::detectCollisions(), MSLane::getFollowersOnConsecutive(), MSLaneChangerSublane::getLeaders(), MSLane::getLeadersOnConsecutive(), MSLCM_SL2015::getLongest(), MSLCM_SL2015::getSlowest(), MSEdge::initialize(), MSLane::isInsertionSuccess(), MSLane::safeInsertionSpeed(), MSLCM_SL2015::updateCFRelated(), MSLCM_SL2015::updateExpectedSublaneSpeeds(), and MSLCM_SL2015::updateGaps().
CLeaderDist MSLeaderDistanceInfo::operator[] | ( | int | sublane | ) | const |
return the vehicle and its distance for the given sublane
Definition at line 261 of file MSLeaderInfo.cpp.
References myDistances, and MSLeaderInfo::myVehicles.
|
virtual |
print a debugging representation
Reimplemented from MSLeaderInfo.
Reimplemented in MSCriticalFollowerDistanceInfo.
Definition at line 269 of file MSLeaderInfo.cpp.
References Named::getIDSecure(), myDistances, MSLeaderInfo::myFreeSublanes, and MSLeaderInfo::myVehicles.
Referenced by MSLCM_SL2015::_wantsChangeSublane(), MSLaneChangerSublane::checkChangeSublane(), MSLaneChangerSublane::getLeaders(), and MSLCM_SL2015::updateCFRelated().
|
protectedinherited |
Definition at line 122 of file MSLeaderInfo.h.
Referenced by MSCriticalFollowerDistanceInfo::addFollower(), MSLeaderInfo::addLeader(), addLeader(), MSLeaderInfo::clear(), and MSLeaderInfo::MSLeaderInfo().
|
protectedinherited |
borders of the ego vehicle for filtering of free sublanes
Definition at line 121 of file MSLeaderInfo.h.
Referenced by MSCriticalFollowerDistanceInfo::addFollower(), MSLeaderInfo::addLeader(), addLeader(), MSLeaderInfo::clear(), and MSLeaderInfo::MSLeaderInfo().
|
protected |
Definition at line 173 of file MSLeaderInfo.h.
Referenced by MSCriticalFollowerDistanceInfo::addFollower(), addLeader(), clear(), getDistances(), operator[](), toString(), and MSCriticalFollowerDistanceInfo::toString().
|
protectedinherited |
the number of free sublanes
Definition at line 118 of file MSLeaderInfo.h.
Referenced by MSCriticalFollowerDistanceInfo::addFollower(), MSLeaderInfo::addLeader(), addLeader(), MSLeaderInfo::clear(), MSLeaderInfo::MSLeaderInfo(), MSLeaderInfo::numFreeSublanes(), MSLeaderInfo::toString(), toString(), and MSCriticalFollowerDistanceInfo::toString().
|
protectedinherited |
Definition at line 124 of file MSLeaderInfo.h.
Referenced by MSCriticalFollowerDistanceInfo::addFollower(), MSLeaderInfo::addLeader(), addLeader(), MSLeaderInfo::hasStoppedVehicle(), MSLeaderInfo::hasVehicles(), and MSLeaderDistanceInfo().
|
protectedinherited |
Definition at line 113 of file MSLeaderInfo.h.
Referenced by MSCriticalFollowerDistanceInfo::addFollower(), MSLeaderInfo::addLeader(), addLeader(), MSLeaderInfo::clear(), clear(), MSCriticalFollowerDistanceInfo::clear(), MSLeaderInfo::getSublaneBorders(), MSLeaderInfo::getSubLanes(), MSLeaderInfo::getVehicles(), MSLeaderInfo::hasStoppedVehicle(), MSLeaderDistanceInfo(), MSLeaderInfo::MSLeaderInfo(), MSLeaderInfo::numSublanes(), MSLeaderInfo::operator[](), operator[](), MSLeaderInfo::toString(), toString(), and MSCriticalFollowerDistanceInfo::toString().
|
protectedinherited |
the width of the lane to which this instance applies
Definition at line 111 of file MSLeaderInfo.h.
Referenced by MSLeaderInfo::getSublaneBorders(), and MSLeaderInfo::getSubLanes().