Eclipse 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 | |
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 | hasVehicles () const |
MSLeaderInfo (const double laneWidth, const MSVehicle *ego=nullptr, const double latOffset=0.) | |
Constructor. | |
int | numFreeSublanes () const |
int | numSublanes () const |
const MSVehicle * | operator[] (int sublane) const |
return the vehicle for the given sublane | |
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 | |
virtual std::string | toString () const |
print a debugging representation | |
virtual | ~MSLeaderInfo () |
Destructor. | |
Protected Attributes | |
int | egoLeftMost |
int | egoRightMost |
borders of the ego vehicle for filtering of free sublanes | |
int | myFreeSublanes |
the number of free sublanes | |
bool | myHasVehicles |
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 | |
Definition at line 48 of file MSLeaderInfo.h.
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.
|
virtual |
Destructor.
Definition at line 54 of file MSLeaderInfo.cpp.
|
virtual |
Reimplemented in MSLeaderDistanceInfo, and MSCriticalFollowerDistanceInfo.
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().
|
virtual |
discard all information
Reimplemented in MSLeaderDistanceInfo, and MSCriticalFollowerDistanceInfo.
Definition at line 93 of file MSLeaderInfo.cpp.
References egoLeftMost, egoRightMost, myFreeSublanes, and myVehicles.
Referenced by MSLeaderDistanceInfo::clear(), and MSVehicle::planMoveInternal().
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().
|
inline |
Definition at line 102 of file MSLeaderInfo.h.
References myOffset.
Referenced by MSVehicle::adaptToLeaders(), and MSLane::getFollowersOnConsecutive().
void MSLeaderInfo::getSubLanes | ( | const MSVehicle * | veh, |
double | latOffset, | ||
int & | rightmost, | ||
int & | leftmost | ||
) | const |
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(), myOffset, myVehicles, and myWidth.
Referenced by MSVehicle::adaptToLeaderDistance(), MSVehicle::adaptToLeaders(), MSCriticalFollowerDistanceInfo::addFollower(), addLeader(), MSLeaderDistanceInfo::addLeader(), MSLeaderInfo(), MSLCM_SL2015::mustOvertakeStopped(), MSAbstractLaneChangeModel::setFollowerGaps(), MSAbstractLaneChangeModel::setLeaderGaps(), and MSAbstractLaneChangeModel::setOrigLeaderGaps().
|
inline |
Definition at line 98 of file MSLeaderInfo.h.
References myVehicles.
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().
|
inline |
Definition at line 94 of file MSLeaderInfo.h.
References myHasVehicles.
Referenced by MSLCM_SL2015::_wantsChangeSublane(), MSLaneChangerSublane::change(), MSLaneChangerSublane::checkChangeSublane(), MSLCM_SL2015::checkStrategicChange(), MSLCM_SL2015::commitFollowSpeed(), MSLeaderDistanceInfo::getClosest(), LIBSUMO_NAMESPACE::Vehicle::getNeighbors(), MSLane::isInsertionSuccess(), MSVehicle::planMoveInternal(), and MSLCM_SL2015::updateGaps().
|
inline |
Definition at line 90 of file MSLeaderInfo.h.
References myFreeSublanes.
Referenced by MSLane::addLeaders(), MSLane::getFollowersOnConsecutive(), MSLane::getLeadersOnConsecutive(), and MSLane::isInsertionSuccess().
|
inline |
Definition at line 86 of file MSLeaderInfo.h.
References myVehicles.
Referenced by MSLCM_SL2015::_wantsChangeSublane(), MSLane::addLeaders(), MSLeaderDistanceInfo::addLeaders(), MSLCM_SL2015::checkBlockingVehicles(), MSLaneChangerSublane::checkChangeOpposite(), MSEdge::closeBuilding(), MSLCM_SL2015::commitFollowSpeed(), MSLCM_SL2015::computeSublaneShift(), MSLaneChangerSublane::findClosestLeader(), MSLane::getFollowersOnConsecutive(), MSLaneChangerSublane::getLeaders(), MSLane::getLeadersOnConsecutive(), MSLCM_SL2015::getLongest(), LIBSUMO_NAMESPACE::Vehicle::getNeighbors(), MSLCM_SL2015::getSlowest(), MSEdge::initialize(), MSLane::isInsertionSuccess(), MSLCM_SL2015::mustOvertakeStopped(), MSVehicle::planMoveInternal(), MSLane::safeInsertionSpeed(), MSLCM_SL2015::updateCFRelated(), MSLCM_SL2015::updateExpectedSublaneSpeeds(), and MSLCM_SL2015::updateGaps().
const MSVehicle * MSLeaderInfo::operator[] | ( | int | sublane | ) | const |
return the vehicle for the given sublane
Definition at line 163 of file MSLeaderInfo.cpp.
References myVehicles.
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().
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().
|
virtual |
print a debugging representation
Reimplemented in MSLeaderDistanceInfo, and MSCriticalFollowerDistanceInfo.
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().
|
protected |
Definition at line 136 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 135 of file MSLeaderInfo.h.
Referenced by MSCriticalFollowerDistanceInfo::addFollower(), addLeader(), MSLeaderDistanceInfo::addLeader(), clear(), and MSLeaderInfo().
|
protected |
the number of free sublanes
Definition at line 132 of file MSLeaderInfo.h.
Referenced by MSCriticalFollowerDistanceInfo::addFollower(), addLeader(), MSLeaderDistanceInfo::addLeader(), clear(), MSLeaderInfo(), numFreeSublanes(), toString(), MSLeaderDistanceInfo::toString(), and MSCriticalFollowerDistanceInfo::toString().
|
protected |
Definition at line 138 of file MSLeaderInfo.h.
Referenced by MSCriticalFollowerDistanceInfo::addFollower(), addLeader(), MSLeaderDistanceInfo::addLeader(), hasStoppedVehicle(), hasVehicles(), and MSLeaderDistanceInfo::MSLeaderDistanceInfo().
|
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().
|
protected |
Definition at line 127 of file MSLeaderInfo.h.
Referenced by MSCriticalFollowerDistanceInfo::addFollower(), addLeader(), MSLeaderDistanceInfo::addLeader(), clear(), MSLeaderDistanceInfo::clear(), MSCriticalFollowerDistanceInfo::clear(), MSLeaderDistanceInfo::fixOppositeGaps(), MSLeaderDistanceInfo::getClosest(), getSublaneBorders(), getSubLanes(), getVehicles(), hasStoppedVehicle(), MSLeaderDistanceInfo::moveSamePosTo(), MSLeaderDistanceInfo::MSLeaderDistanceInfo(), MSLeaderInfo(), numSublanes(), operator[](), MSLeaderDistanceInfo::operator[](), MSLeaderDistanceInfo::patchGaps(), removeOpposite(), toString(), MSLeaderDistanceInfo::toString(), and MSCriticalFollowerDistanceInfo::toString().
|
protected |
the width of the lane to which this instance applies
Definition at line 122 of file MSLeaderInfo.h.
Referenced by getSublaneBorders(), and getSubLanes().