![]() |
SUMO - Simulation of Urban MObility
|
#include <MSLeaderInfo.h>
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 |
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 MSVehicle * | operator[] (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... | |
Definition at line 57 of file MSLeaderInfo.h.
Constructor.
Definition at line 49 of file MSLeaderInfo.cpp.
References egoLeftMost, egoRightMost, getSubLanes(), myFreeSublanes, and myVehicles.
|
virtual |
Destructor.
Definition at line 65 of file MSLeaderInfo.cpp.
|
virtual |
Reimplemented in MSCriticalFollowerDistanceInfo, and MSLeaderDistanceInfo.
Definition at line 69 of file MSLeaderInfo.cpp.
References egoLeftMost, egoRightMost, getSubLanes(), myFreeSublanes, myHasVehicles, and myVehicles.
Referenced by MSLane::getFirstVehicleInformation(), MSLane::getLastVehicleInformation(), MSVehicle::planMoveInternal(), and MSLane::planMovements().
|
virtual |
discard all information
Reimplemented in MSCriticalFollowerDistanceInfo, and MSLeaderDistanceInfo.
Definition at line 100 of file MSLeaderInfo.cpp.
References egoLeftMost, egoRightMost, myFreeSublanes, and myVehicles.
Referenced by MSLeaderDistanceInfo::addLeader(), MSCriticalFollowerDistanceInfo::addLeader(), MSLeaderDistanceInfo::clear(), and MSVehicle::planMoveInternal().
void MSLeaderInfo::getSublaneBorders | ( | int | sublane, |
double | latOffset, | ||
double & | rightSide, | ||
double & | leftSide | ||
) | const |
Definition at line 138 of file MSLeaderInfo.cpp.
References MSGlobals::gLateralResolution, MIN2(), myVehicles, and myWidth.
Referenced by MSLCM_SL2015::checkBlockingVehicles(), and MSLCM_SL2015::updateGaps().
void MSLeaderInfo::getSubLanes | ( | const MSVehicle * | veh, |
double | latOffset, | ||
int & | rightmost, | ||
int & | leftmost | ||
) | const |
Definition at line 111 of file MSLeaderInfo.cpp.
References MSVehicle::getLateralPositionOnLane(), MSBaseVehicle::getVehicleType(), MSVehicleType::getWidth(), MSGlobals::gLateralResolution, MAX2(), MIN2(), myVehicles, myWidth, and NUMERICAL_EPS.
Referenced by MSVehicle::adaptToLeaders(), MSCriticalFollowerDistanceInfo::addFollower(), addLeader(), MSLeaderDistanceInfo::addLeader(), and MSLeaderInfo().
bool MSLeaderInfo::hasStoppedVehicle | ( | ) | const |
whether a stopped vehicle is leader
Definition at line 171 of file MSLeaderInfo.cpp.
References myHasVehicles, and myVehicles.
Referenced by MSLCM_SL2015::_wantsChangeSublane(), MSLCM_SL2015::checkStrategicChange(), and hasVehicles().
|
inline |
Definition at line 103 of file MSLeaderInfo.h.
References hasStoppedVehicle(), myHasVehicles, and toString().
Referenced by MSLCM_SL2015::checkStrategicChange(), and MSLCM_SL2015::updateGaps().
|
inline |
Definition at line 99 of file MSLeaderInfo.h.
References myFreeSublanes.
Referenced by MSLane::getFollowersOnConsecutive(), MSLaneChangerSublane::getLeaders(), MSLane::getLeadersOnConsecutive(), and MSLane::isInsertionSuccess().
|
inline |
Definition at line 95 of file MSLeaderInfo.h.
References myVehicles.
Referenced by MSLCM_SL2015::checkBlockingVehicles(), MSLCM_SL2015::computeSublaneShift(), MSLane::detectCollisions(), MSLaneChangerSublane::getLeaders(), MSLane::getLeadersOnConsecutive(), MSLCM_SL2015::getLongest(), MSLCM_SL2015::getSlowest(), MSEdge::initialize(), MSLane::isInsertionSuccess(), MSLane::safeInsertionSpeed(), MSLCM_SL2015::updateExpectedSublaneSpeeds(), and MSLCM_SL2015::updateGaps().
const MSVehicle * MSLeaderInfo::operator[] | ( | int | sublane | ) | const |
return the vehicle for the given sublane
Definition at line 147 of file MSLeaderInfo.cpp.
References myVehicles.
Referenced by MSLeaderDistanceInfo::addLeader().
|
virtual |
print a debugging representation
Reimplemented in MSCriticalFollowerDistanceInfo, and MSLeaderDistanceInfo.
Definition at line 155 of file MSLeaderInfo.cpp.
References Named::getIDSecure(), myFreeSublanes, and myVehicles.
Referenced by MSVehicle::adaptToLeaders(), MSLeaderDistanceInfo::addLeader(), MSCriticalFollowerDistanceInfo::addLeader(), MSLane::getFollowersOnConsecutive(), MSLane::getLastVehicleInformation(), MSLane::getLeadersOnConsecutive(), hasVehicles(), MSLane::isInsertionSuccess(), and MSLane::planMovements().
|
protected |
Definition at line 128 of file MSLeaderInfo.h.
Referenced by MSCriticalFollowerDistanceInfo::addFollower(), addLeader(), MSLeaderDistanceInfo::addLeader(), clear(), and MSLeaderInfo().
|
protected |
borders of the ego vehicle for filtering of free sublanes
Definition at line 127 of file MSLeaderInfo.h.
Referenced by MSCriticalFollowerDistanceInfo::addFollower(), addLeader(), MSLeaderDistanceInfo::addLeader(), clear(), and MSLeaderInfo().
|
protected |
the number of free sublanes
Definition at line 124 of file MSLeaderInfo.h.
Referenced by MSCriticalFollowerDistanceInfo::addFollower(), addLeader(), MSLeaderDistanceInfo::addLeader(), clear(), MSLeaderInfo(), numFreeSublanes(), toString(), MSLeaderDistanceInfo::toString(), and MSCriticalFollowerDistanceInfo::toString().
|
protected |
Definition at line 130 of file MSLeaderInfo.h.
Referenced by MSCriticalFollowerDistanceInfo::addFollower(), addLeader(), MSLeaderDistanceInfo::addLeader(), hasStoppedVehicle(), and hasVehicles().
|
protected |
Definition at line 119 of file MSLeaderInfo.h.
Referenced by MSCriticalFollowerDistanceInfo::addFollower(), addLeader(), MSLeaderDistanceInfo::addLeader(), clear(), MSLeaderDistanceInfo::clear(), MSCriticalFollowerDistanceInfo::clear(), getSublaneBorders(), getSubLanes(), hasStoppedVehicle(), MSLeaderDistanceInfo::MSLeaderDistanceInfo(), MSLeaderInfo(), numSublanes(), operator[](), MSLeaderDistanceInfo::operator[](), toString(), MSLeaderDistanceInfo::toString(), and MSCriticalFollowerDistanceInfo::toString().
|
protected |
the width of the lane to which this instance applies
Definition at line 117 of file MSLeaderInfo.h.
Referenced by getSublaneBorders(), and getSubLanes().