Eclipse SUMO - Simulation of Urban MObility
|
#include <MSLeaderInfo.h>
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 |
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 |
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 | |
Definition at line 209 of file MSLeaderInfo.h.
MSCriticalFollowerDistanceInfo::MSCriticalFollowerDistanceInfo | ( | const double | laneWidth, |
const MSVehicle * | ego, | ||
const double | latOffset, | ||
const bool | haveOppositeLeaders = false |
||
) |
Constructor.
Definition at line 393 of file MSLeaderInfo.cpp.
|
virtual |
Destructor.
Definition at line 400 of file MSLeaderInfo.cpp.
int MSCriticalFollowerDistanceInfo::addFollower | ( | const MSVehicle * | veh, |
const MSVehicle * | ego, | ||
double | gap, | ||
double | latOffset = 0 , |
||
int | sublane = -1 |
||
) |
Definition at line 404 of file MSLeaderInfo.cpp.
References MSLeaderInfo::egoLeftMost, MSLeaderInfo::egoRightMost, MSVehicle::getCarFollowModel(), MSCFModel::getMaxDecel(), MSCFModel::getSecureGap(), MSVehicle::getSpeed(), MSLeaderInfo::getSubLanes(), MSLeaderDistanceInfo::myDistances, MSLeaderInfo::myFreeSublanes, MSLeaderInfo::myHasVehicles, myHaveOppositeLeaders, myMissingGaps, and MSLeaderInfo::myVehicles.
Referenced by MSLane::getFollowersOnConsecutive().
|
inlinevirtual |
Reimplemented from MSLeaderDistanceInfo.
Definition at line 235 of file MSLeaderInfo.h.
References TL, and UNUSED_PARAMETER.
|
inlinevirtual |
Reimplemented from MSLeaderDistanceInfo.
Definition at line 227 of file MSLeaderInfo.h.
References TL, and UNUSED_PARAMETER.
|
virtualinherited |
updatd empty sublanes with vehicles and gaps from other
Definition at line 285 of file MSLeaderInfo.cpp.
References MSLeaderDistanceInfo::addLeader(), MIN2(), and MSLeaderInfo::numSublanes().
Referenced by MSLaneChangerSublane::checkChangeSublane().
|
virtual |
discard all information
Reimplemented from MSLeaderDistanceInfo.
Definition at line 481 of file MSLeaderInfo.cpp.
References MSLeaderDistanceInfo::clear(), myMissingGaps, and MSLeaderInfo::myVehicles.
|
inherited |
subtract vehicle length from all gaps if the leader vehicle is driving in the opposite direction
Definition at line 333 of file MSLeaderInfo.cpp.
References MSLeaderDistanceInfo::myDistances, and MSLeaderInfo::myVehicles.
Referenced by MSLaneChangerSublane::checkChangeOpposite(), LIBSUMO_NAMESPACE::Vehicle::getNeighbors(), and MSVehicle::planMoveInternal().
|
inherited |
return vehicle with the smalles gap
Definition at line 358 of file MSLeaderInfo.cpp.
References MSLeaderInfo::hasVehicles(), MSLeaderDistanceInfo::myDistances, and MSLeaderInfo::myVehicles.
Referenced by MSLane::getFollower().
|
inlineinherited |
Definition at line 184 of file MSLeaderInfo.h.
References MSLeaderDistanceInfo::myDistances.
|
inherited |
Definition at line 153 of file MSLeaderInfo.cpp.
References MSGlobals::gLateralResolution, MIN2(), MSLeaderInfo::myOffset, MSLeaderInfo::myVehicles, and MSLeaderInfo::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 MSLeaderInfo::myOffset.
Referenced by MSVehicle::adaptToLeaders(), and MSLane::getFollowersOnConsecutive().
|
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::myOffset, MSLeaderInfo::myVehicles, and MSLeaderInfo::myWidth.
Referenced by MSVehicle::adaptToLeaderDistance(), MSVehicle::adaptToLeaders(), addFollower(), MSLeaderInfo::addLeader(), MSLeaderDistanceInfo::addLeader(), MSLeaderInfo::MSLeaderInfo(), MSLCM_SL2015::mustOvertakeStopped(), MSAbstractLaneChangeModel::setFollowerGaps(), MSAbstractLaneChangeModel::setLeaderGaps(), and MSAbstractLaneChangeModel::setOrigLeaderGaps().
|
inlineinherited |
Definition at line 98 of file MSLeaderInfo.h.
References MSLeaderInfo::myVehicles.
|
inherited |
whether a stopped vehicle is leader
Definition at line 194 of file MSLeaderInfo.cpp.
References MSLeaderInfo::myHasVehicles, and MSLeaderInfo::myVehicles.
Referenced by MSLCM_SL2015::_wantsChangeSublane(), MSLCM_SL2015::checkStrategicChange(), and MSLCM_SL2015::mustOvertakeStopped().
|
inlineinherited |
Definition at line 94 of file MSLeaderInfo.h.
References MSLeaderInfo::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().
|
inherited |
Definition at line 375 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 MSLeaderInfo::myFreeSublanes.
Referenced by MSLane::addLeaders(), MSLane::getFollowersOnConsecutive(), MSLane::getLeadersOnConsecutive(), and MSLane::isInsertionSuccess().
|
inlineinherited |
Definition at line 86 of file MSLeaderInfo.h.
References MSLeaderInfo::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().
|
inherited |
return the vehicle and its distance for the given sublane
Definition at line 305 of file MSLeaderInfo.cpp.
References MSLeaderDistanceInfo::myDistances, and MSLeaderInfo::myVehicles.
|
inherited |
add given value to all gaps
Definition at line 349 of file MSLeaderInfo.cpp.
References MSLeaderDistanceInfo::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 207 of file MSLeaderInfo.cpp.
References MSLane::getEdge(), MSVehicle::getLane(), MSVehicle::getLaneChangeModel(), MSAbstractLaneChangeModel::isOpposite(), and MSLeaderInfo::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 MSLeaderInfo::myOffset.
Referenced by MSLaneChangerSublane::addOutsideLeaders(), MSLane::getFollowersOnConsecutive(), MSLaneChangerSublane::getLeaders(), and MSVehicle::planMoveInternal().
|
virtual |
print a debugging representation
Reimplemented from MSLeaderDistanceInfo.
Definition at line 488 of file MSLeaderInfo.cpp.
References Named::getIDSecure(), MSLeaderDistanceInfo::myDistances, MSLeaderInfo::myFreeSublanes, myMissingGaps, and MSLeaderInfo::myVehicles.
Referenced by MSLane::getFollowersOnConsecutive().
|
protectedinherited |
Definition at line 136 of file MSLeaderInfo.h.
Referenced by addFollower(), MSLeaderInfo::addLeader(), MSLeaderDistanceInfo::addLeader(), MSLeaderInfo::clear(), and MSLeaderInfo::MSLeaderInfo().
|
protectedinherited |
borders of the ego vehicle for filtering of free sublanes
Definition at line 135 of file MSLeaderInfo.h.
Referenced by addFollower(), MSLeaderInfo::addLeader(), MSLeaderDistanceInfo::addLeader(), MSLeaderInfo::clear(), and MSLeaderInfo::MSLeaderInfo().
|
protectedinherited |
Definition at line 201 of file MSLeaderInfo.h.
Referenced by addFollower(), MSLeaderDistanceInfo::addLeader(), MSLeaderDistanceInfo::clear(), MSLeaderDistanceInfo::fixOppositeGaps(), MSLeaderDistanceInfo::getClosest(), MSLeaderDistanceInfo::getDistances(), MSLeaderDistanceInfo::moveSamePosTo(), MSLeaderDistanceInfo::operator[](), MSLeaderDistanceInfo::patchGaps(), MSLeaderDistanceInfo::toString(), and toString().
|
protectedinherited |
the number of free sublanes
Definition at line 132 of file MSLeaderInfo.h.
Referenced by addFollower(), MSLeaderInfo::addLeader(), MSLeaderDistanceInfo::addLeader(), MSLeaderInfo::clear(), MSLeaderInfo::MSLeaderInfo(), MSLeaderInfo::numFreeSublanes(), MSLeaderInfo::toString(), MSLeaderDistanceInfo::toString(), and toString().
|
protectedinherited |
Definition at line 138 of file MSLeaderInfo.h.
Referenced by addFollower(), MSLeaderInfo::addLeader(), MSLeaderDistanceInfo::addLeader(), MSLeaderInfo::hasStoppedVehicle(), MSLeaderInfo::hasVehicles(), and MSLeaderDistanceInfo::MSLeaderDistanceInfo().
|
protected |
Definition at line 254 of file MSLeaderInfo.h.
Referenced by addFollower().
|
protected |
Definition at line 251 of file MSLeaderInfo.h.
Referenced by addFollower(), clear(), and toString().
|
protectedinherited |
an extra offset for shifting the interpretation of sublane borders (default [0,myWidth])
Definition at line 125 of file MSLeaderInfo.h.
Referenced by MSLeaderInfo::getSublaneBorders(), MSLeaderInfo::getSublaneOffset(), MSLeaderInfo::getSubLanes(), and MSLeaderInfo::setSublaneOffset().
|
protectedinherited |
Definition at line 127 of file MSLeaderInfo.h.
Referenced by addFollower(), MSLeaderInfo::addLeader(), MSLeaderDistanceInfo::addLeader(), MSLeaderInfo::clear(), MSLeaderDistanceInfo::clear(), clear(), MSLeaderDistanceInfo::fixOppositeGaps(), MSLeaderDistanceInfo::getClosest(), MSLeaderInfo::getSublaneBorders(), MSLeaderInfo::getSubLanes(), MSLeaderInfo::getVehicles(), MSLeaderInfo::hasStoppedVehicle(), MSLeaderDistanceInfo::moveSamePosTo(), MSLeaderDistanceInfo::MSLeaderDistanceInfo(), MSLeaderInfo::MSLeaderInfo(), MSLeaderInfo::numSublanes(), MSLeaderInfo::operator[](), MSLeaderDistanceInfo::operator[](), MSLeaderDistanceInfo::patchGaps(), MSLeaderInfo::removeOpposite(), MSLeaderInfo::toString(), MSLeaderDistanceInfo::toString(), and toString().
|
protectedinherited |
the width of the lane to which this instance applies
Definition at line 122 of file MSLeaderInfo.h.
Referenced by MSLeaderInfo::getSublaneBorders(), and MSLeaderInfo::getSubLanes().