![]() |
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 | addLeaders (MSLeaderDistanceInfo &other) |
| updatd empty sublanes with vehicles and gaps from other | |
| virtual 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) |
| MSLeaderDistanceInfo (const CLeaderDist &cLeaderDist, const double laneWidth) | |
| Construct for the non-sublane-case. | |
| MSLeaderDistanceInfo (const double laneWidth, const MSVehicle *ego, const double latOffset) | |
| 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 | |
| virtual std::string | toString () const |
| print a debugging representation | |
| virtual | ~MSLeaderDistanceInfo () |
| 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 |
| 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 | |
saves leader/follower vehicles and their distances relative to an ego vehicle
Definition at line 147 of file MSLeaderInfo.h.
| MSLeaderDistanceInfo::MSLeaderDistanceInfo | ( | const double | laneWidth, |
| const MSVehicle * | ego, | ||
| const double | latOffset ) |
Constructor.
Definition at line 236 of file MSLeaderInfo.cpp.
References MSLeaderInfo::MSLeaderInfo(), myDistances, and MSLeaderInfo::myVehicles.
Referenced by addLeaders(), moveSamePosTo(), and MSCriticalFollowerDistanceInfo::MSCriticalFollowerDistanceInfo().
| MSLeaderDistanceInfo::MSLeaderDistanceInfo | ( | const CLeaderDist & | cLeaderDist, |
| const double | laneWidth ) |
Construct for the non-sublane-case.
Definition at line 242 of file MSLeaderInfo.cpp.
References MSLeaderInfo::MSLeaderInfo(), myDistances, MSLeaderInfo::myHasVehicles, and MSLeaderInfo::myVehicles.
|
virtual |
Destructor.
Definition at line 250 of file MSLeaderInfo.cpp.
|
inlinevirtual |
Reimplemented from MSLeaderInfo.
Reimplemented in MSCriticalFollowerDistanceInfo.
Definition at line 168 of file MSLeaderInfo.h.
References TL, and UNUSED_PARAMETER.
|
virtual |
Reimplemented in MSCriticalFollowerDistanceInfo.
Definition at line 254 of file MSLeaderInfo.cpp.
References MSLeaderInfo::egoLeftMost, MSLeaderInfo::egoRightMost, MSLeaderInfo::getSubLanes(), myDistances, MSLeaderInfo::myFreeSublanes, MSLeaderInfo::myHasVehicles, and MSLeaderInfo::myVehicles.
Referenced by addLeaders(), MSLaneChangerSublane::addOutsideLeaders(), LIBSUMO_NAMESPACE::Vehicle::getNeighbors(), and MSVehicle::planMoveInternal().
|
virtual |
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().
|
virtual |
discard all information
Reimplemented from MSLeaderInfo.
Reimplemented in MSCriticalFollowerDistanceInfo.
Definition at line 312 of file MSLeaderInfo.cpp.
References MSLeaderInfo::clear(), myDistances, and MSLeaderInfo::myVehicles.
Referenced by MSCriticalFollowerDistanceInfo::clear().
| void MSLeaderDistanceInfo::fixOppositeGaps | ( | bool | isFollower | ) |
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().
| CLeaderDist MSLeaderDistanceInfo::getClosest | ( | ) | const |
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().
|
inline |
Definition at line 187 of file MSLeaderInfo.h.
References myDistances.
| double MSLeaderDistanceInfo::getMinDistToStopped | ( | ) | const |
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().
|
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().
|
inlineinherited |
Definition at line 102 of file MSLeaderInfo.h.
References myOffset.
Referenced by MSVehicle::adaptToLeaders().
|
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(), myOffset, myVehicles, and myWidth.
Referenced by MSVehicle::adaptToLeaderDistance(), MSVehicle::adaptToLeaders(), MSCriticalFollowerDistanceInfo::addFollower(), MSLeaderDistanceInfo::addLeader(), addLeader(), MSLeaderInfo(), MSLCM_SL2015::mustOvertakeStopped(), MSAbstractLaneChangeModel::setFollowerGaps(), MSAbstractLaneChangeModel::setLeaderGaps(), and MSAbstractLaneChangeModel::setOrigLeaderGaps().
|
inlineinherited |
Definition at line 98 of file MSLeaderInfo.h.
References myVehicles.
|
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().
|
inherited |
whether the given vehicle is part of this leaderInfo
Definition at line 208 of file MSLeaderInfo.cpp.
References myHasVehicles, and myVehicles.
|
inlineinherited |
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().
| void MSLeaderDistanceInfo::moveSamePosTo | ( | const MSVehicle * | ego, |
| MSLeaderDistanceInfo & | other ) |
Definition at line 389 of file MSLeaderInfo.cpp.
References MSLane::getEdge(), MSVehicle::getLane(), MSVehicle::getPositionOnLane(), MSLeaderDistanceInfo(), myDistances, and MSLeaderInfo::myVehicles.
Referenced by MSLaneChangerSublane::checkChangeSublane().
|
inlineinherited |
Definition at line 90 of file MSLeaderInfo.h.
References myFreeSublanes.
Referenced by MSLane::isInsertionSuccess().
|
inlineinherited |
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(), 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().
| CLeaderDist MSLeaderDistanceInfo::operator[] | ( | int | sublane | ) | const |
return the vehicle and its distance for the given sublane
Definition at line 319 of file MSLeaderInfo.cpp.
References myDistances, and MSLeaderInfo::myVehicles.
| void MSLeaderDistanceInfo::patchGaps | ( | double | amount | ) |
add given value to all gaps
Definition at line 363 of file MSLeaderInfo.cpp.
References myDistances, and MSLeaderInfo::myVehicles.
Referenced by MSLaneChangerSublane::checkChangeOpposite().
|
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().
|
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().
|
virtual |
print a debugging representation
Reimplemented from MSLeaderInfo.
Reimplemented in MSCriticalFollowerDistanceInfo.
Definition at line 327 of file MSLeaderInfo.cpp.
References Named::getIDSecure(), myDistances, MSLeaderInfo::myFreeSublanes, and MSLeaderInfo::myVehicles.
Referenced by MSLCM_SL2015::_wantsChangeSublane(), MSVehicle::adaptToLeaderDistance(), MSLaneChangerSublane::addOutsideLeaders(), MSLaneChangerSublane::checkChangeOpposite(), MSLaneChangerSublane::checkChangeSublane(), MSVehicle::planMoveInternal(), MSLCM_SL2015::updateCFRelated(), and MSLCM_SL2015::updateExpectedSublaneSpeeds().
|
protectedinherited |
Definition at line 139 of file MSLeaderInfo.h.
Referenced by MSCriticalFollowerDistanceInfo::addFollower(), MSLeaderDistanceInfo::addLeader(), addLeader(), clear(), and MSLeaderInfo().
|
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().
|
protected |
Definition at line 208 of file MSLeaderInfo.h.
Referenced by MSCriticalFollowerDistanceInfo::addFollower(), addLeader(), clear(), fixOppositeGaps(), getClosest(), getDistances(), getMinDistToStopped(), moveSamePosTo(), MSLeaderDistanceInfo(), MSLeaderDistanceInfo(), operator[](), patchGaps(), MSCriticalFollowerDistanceInfo::toString(), and toString().
|
protectedinherited |
the number of free sublanes
Definition at line 135 of file MSLeaderInfo.h.
Referenced by MSCriticalFollowerDistanceInfo::addFollower(), MSLeaderDistanceInfo::addLeader(), addLeader(), clear(), MSLeaderInfo(), numFreeSublanes(), MSCriticalFollowerDistanceInfo::toString(), MSLeaderDistanceInfo::toString(), and toString().
|
protectedinherited |
Definition at line 141 of file MSLeaderInfo.h.
Referenced by MSCriticalFollowerDistanceInfo::addFollower(), MSLeaderDistanceInfo::addLeader(), addLeader(), MSLeaderDistanceInfo::getMinDistToStopped(), hasStoppedVehicle(), hasVehicle(), hasVehicles(), MSLeaderDistanceInfo::MSLeaderDistanceInfo(), and MSLeaderInfo().
|
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().
|
protectedinherited |
Definition at line 130 of file MSLeaderInfo.h.
Referenced by MSCriticalFollowerDistanceInfo::addFollower(), MSLeaderDistanceInfo::addLeader(), addLeader(), MSCriticalFollowerDistanceInfo::clear(), MSLeaderDistanceInfo::clear(), clear(), MSLeaderDistanceInfo::fixOppositeGaps(), MSLeaderDistanceInfo::getClosest(), MSLeaderDistanceInfo::getMinDistToStopped(), getSublaneBorders(), getSubLanes(), getVehicles(), hasStoppedVehicle(), hasVehicle(), MSLeaderDistanceInfo::moveSamePosTo(), MSCriticalFollowerDistanceInfo::MSCriticalFollowerDistanceInfo(), MSLeaderDistanceInfo::MSLeaderDistanceInfo(), MSLeaderDistanceInfo::MSLeaderDistanceInfo(), MSLeaderInfo(), numSublanes(), MSLeaderDistanceInfo::operator[](), operator[](), MSLeaderDistanceInfo::patchGaps(), removeOpposite(), MSCriticalFollowerDistanceInfo::toString(), MSLeaderDistanceInfo::toString(), and toString().
|
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().