Eclipse SUMO - Simulation of Urban MObility
Loading...
Searching...
No Matches
MSLaneChangerSublane Class Reference

Performs lane changing of vehicles. More...

#include <MSLaneChangerSublane.h>

Inheritance diagram for MSLaneChangerSublane:
[legend]
Collaboration diagram for MSLaneChangerSublane:
[legend]

Public Types

typedef std::vector< ChangeElemChanger
 The list of changers; For each lane, a ChangeElem is being build.
 
typedef Changer::iterator ChangerIt
 the iterator moving over the ChangeElems
 
typedef Changer::const_iterator ConstChangerIt
 the iterator moving over the ChangeElems
 

Public Member Functions

ChangergetChanger ()
 return changer (only to be used by MSLaneChangerSublane from another instance)
 
void laneChange (SUMOTime t)
 Start lane-change-process for all vehicles on the edge'e lanes.
 
 MSLaneChangerSublane (const std::vector< MSLane * > *lanes, bool allowChanging)
 Constructor.
 
 ~MSLaneChangerSublane ()
 Destructor.
 

Protected Types

typedef MSAbstractLaneChangeModel::StateAndDist StateAndDist
 

Protected Member Functions

void abortLCManeuver (MSVehicle *vehicle)
 immediately stop lane-changing and register vehicle as unchanged
 
void addOutsideLeaders (const MSVehicle *vehicle, MSLeaderDistanceInfo &leaders) const
 
bool applyTraCICommands (MSVehicle *vehicle)
 Execute TraCI LC-commands.
 
bool avoidDeadlock (MSVehicle *vehicle, std::pair< MSVehicle *, double > neighLead, std::pair< MSVehicle *, double > overtaken, std::pair< MSVehicle *, double > leader)
 avoid opposite-diretion deadlock when vehicles are stopped on both sides of the road The method may call saveBlockerLength to affect vehicle speed in the next step
 
virtual bool change ()
 
bool changeOpposite (MSVehicle *vehicle, std::pair< MSVehicle *, double > leader, MSVehicle *lastStopped)
 
int checkChange (int laneOffset, const MSLane *targetLane, const std::pair< MSVehicle *const, double > &leader, const std::pair< MSVehicle *const, double > &follower, const std::pair< MSVehicle *const, double > &neighLead, const std::pair< MSVehicle *const, double > &neighFollow, const std::vector< MSVehicle::LaneQ > &preb) const
 
StateAndDist checkChangeHelper (MSVehicle *vehicle, int laneOffset, LaneChangeAction alternatives)
 helper function that calls checkChangeSublane and sets blocker information
 
bool checkChangeOpposite (MSVehicle *vehicle, int laneOffset, MSLane *targetLane, const std::pair< MSVehicle *const, double > &leader, const std::pair< MSVehicle *const, double > &neighLead, const std::pair< MSVehicle *const, double > &neighFollow, const std::vector< MSVehicle::LaneQ > &preb)
 
int checkChangeSublane (int laneOffset, LaneChangeAction alternatives, const std::vector< MSVehicle::LaneQ > &preb, double &latDist, double &maneuverDist) const
 check whether sub-lane changing in the given direction is desirable and possible
 
bool checkChangeToNewLane (MSVehicle *vehicle, const int direction, ChangerIt from, ChangerIt to)
 check whether the given vehicle has entered the new lane 'to->lane' during a sublane LC-step
 
int checkChangeWithinEdge (int laneOffset, const std::pair< MSVehicle *const, double > &leader, const std::vector< MSVehicle::LaneQ > &preb) const
 
bool checkOppositeStop (MSVehicle *vehicle, const MSLane *oncomingLane, const MSLane *opposite, std::pair< MSVehicle *, double > leader)
 decide whether to change (back or forth) for an opposite stop
 
void checkTraCICommands (MSVehicle *vehicle)
 Take into account traci LC-commands.
 
double computeSafeOppositeLength (MSVehicle *vehicle, double oppositeLength, const MSLane *source, double usableDist, std::pair< MSVehicle *, double > oncoming, double vMax, double oncomingSpeed, std::pair< MSVehicle *, double > neighLead, std::pair< MSVehicle *, double > overtaken, std::pair< MSVehicle *, double > neighFollow, double surplusGap, const MSLane *opposite, bool canOvertake)
 determine for how long the vehicle can drive safely on the opposite side
 
bool continueChange (MSVehicle *vehicle, ChangerIt &from)
 continue a lane change maneuver and return whether the vehicle has completely moved onto the new lane (used if gLaneChangeDuration > 0)
 
bool continueChangeSublane (MSVehicle *vehicle, ChangerIt &from)
 Continue a sublane-lane change maneuver and return whether the midpoint was passed in this step.
 
ChangerIt findCandidate ()
 Find current candidate. If there is none, myChanger.end() is returned.
 
MSLeaderDistanceInfo getLeaders (const ChangerIt &target, const MSVehicle *ego) const
 get leaders for ego on the given lane
 
std::pair< MSVehicle *const, double > getOncomingOppositeVehicle (const MSVehicle *vehicle, std::pair< MSVehicle *, double > overtaken, double searchDist)
 
std::pair< MSVehicle *const, double > getOncomingVehicle (const MSLane *opposite, std::pair< MSVehicle *, double > neighOncoming, double searchDist, double &vMax, const MSVehicle *overtaken=nullptr, MSLane::MinorLinkMode mLinkMode=MSLane::MinorLinkMode::FOLLOW_NEVER)
 
std::pair< MSVehicle *const, double > getRealFollower (const ChangerIt &target) const
 
std::pair< MSVehicle *const, double > getRealLeader (const ChangerIt &target) const
 
virtual void initChanger ()
 Initialize the changer before looping over all vehicles.
 
bool mayChange (int direction) const
 whether changing to the lane in the given direction should be considered
 
void outputLCEnded (MSVehicle *vehicle, ChangerIt &from, ChangerIt &to, int direction)
 optional output for end of lane-change maneuvre
 
void outputLCStarted (MSVehicle *vehicle, ChangerIt &from, ChangerIt &to, int direction, double maneuverDist)
 optional output for start of lane-change maneuvre
 
void registerUnchanged (MSVehicle *vehicle)
 
bool resolveDeadlock (MSVehicle *vehicle, std::pair< MSVehicle *const, double > leader, std::pair< MSVehicle *, double > neighLead, std::pair< MSVehicle *, double > overtaken)
 keep stopping to resolve opposite-diretion deadlock while there is oncoming traffic The method may call saveBlockerLength to affect vehicle speed in the next step
 
bool startChange (MSVehicle *vehicle, ChangerIt &from, int direction)
 
bool startChangeSublane (MSVehicle *vehicle, ChangerIt &from, double latDist, double maneuverDist)
 change by the specified amount and return whether a new lane was entered
 
virtual void updateChanger (bool vehHasChanged)
 
void updateLanes (SUMOTime t)
 
MSVehicleveh (ConstChangerIt ce) const
 
bool vehInChanger () const
 Check if there is a single change-candidate in the changer. Returns true if there is one.
 
bool yieldToDeadlockOncoming (const MSVehicle *vehicle, const MSVehicle *stoppedNeigh, double dist)
 check whether to keep stopping for oncoming vehicles in the deadlock zone
 
bool yieldToOppositeWaiting (const MSVehicle *vehicle, const MSVehicle *stoppedNeigh, double dist, SUMOTime deltaWait=0)
 check whether to yield for oncoming vehicles that have waited longer for opposite overtaking
 

Static Protected Member Functions

static void computeOvertakingTime (const MSVehicle *vehicle, double vMax, const MSVehicle *leader, double gap, double &timeToOvertake, double &spaceToOvertake)
 Compute the time and space required for overtaking the given leader.
 
static double computeSurplusGap (const MSVehicle *vehicle, const MSLane *opposite, std::pair< MSVehicle *, double > oncoming, double timeToOvertake, double spaceToOvertake, double &oncomingSpeed, bool oncomingOpposite=false)
 
static std::pair< MSVehicle *, double > findClosestLeader (const MSLeaderDistanceInfo &leaders, const MSVehicle *vehicle)
 find the closest leader that prevents ego vehicle from passing on the current lane
 
static bool foundHilltop (MSVehicle *vehicle, bool foundHill, double searchDist, const std::vector< MSLane * > &bestLanes, int view, double pos, double lastMax, double hilltopThreshold)
 
static std::vector< MSVehicle::LaneQgetBestLanesOpposite (MSVehicle *vehicle, const MSLane *stopLane, double oppositeLength)
 add LaneQ for opposite lanes
 
static MSVehiclegetCloserFollower (const double maxPos, MSVehicle *follow1, MSVehicle *follow2)
 return the closer follower of ego
 
static std::pair< MSVehicle *, double > getColumnleader (double &maxSpace, MSVehicle *vehicle, std::pair< MSVehicle *, double > leader, double maxLookAhead=std::numeric_limits< double >::max())
 return leader vehicle that is to be overtaken
 
static const MSLanegetLaneAfter (const MSLane *lane, const std::vector< MSLane * > &conts, bool allowMinor, bool &contsEnd)
 return the next lane in conts beyond lane or nullptr
 
static double getMaxOvertakingSpeed (const MSVehicle *vehicle, double maxSpaceToOvertake)
 compute maximum maneuver speed
 
static bool hasOppositeStop (MSVehicle *vehicle)
 whether vehicle has an opposite-direction stop within relevant range
 

Protected Attributes

const bool myAllowsChanging
 
ChangerIt myCandi
 
Changer myChanger
 Container for ChangeElemements, one for every lane in the edge.
 
const bool myChangeToOpposite
 whether this edge allows changing to the opposite direction edge
 
bool myCheckedChangeOpposite
 whether checkChangeOpposite was called for the current vehicle
 

Private Member Functions

 MSLaneChangerSublane ()
 Default constructor.
 
 MSLaneChangerSublane (const MSLaneChangerSublane &)
 Copy constructor.
 
MSLaneChangerSublaneoperator= (const MSLaneChangerSublane &)
 Assignment operator.
 

Detailed Description

Performs lane changing of vehicles.

Definition at line 40 of file MSLaneChangerSublane.h.

Member Typedef Documentation

◆ Changer

typedef std::vector< ChangeElem > MSLaneChanger::Changer
inherited

The list of changers; For each lane, a ChangeElem is being build.

Definition at line 108 of file MSLaneChanger.h.

◆ ChangerIt

typedef Changer::iterator MSLaneChanger::ChangerIt
inherited

the iterator moving over the ChangeElems

Definition at line 111 of file MSLaneChanger.h.

◆ ConstChangerIt

typedef Changer::const_iterator MSLaneChanger::ConstChangerIt
inherited

the iterator moving over the ChangeElems

Definition at line 114 of file MSLaneChanger.h.

◆ StateAndDist

Constructor & Destructor Documentation

◆ MSLaneChangerSublane() [1/3]

MSLaneChangerSublane::MSLaneChangerSublane ( const std::vector< MSLane * > *  lanes,
bool  allowChanging 
)

Constructor.

Definition at line 54 of file MSLaneChangerSublane.cpp.

References MSLaneChanger::myChanger.

◆ ~MSLaneChangerSublane()

MSLaneChangerSublane::~MSLaneChangerSublane ( )

Destructor.

Definition at line 70 of file MSLaneChangerSublane.cpp.

◆ MSLaneChangerSublane() [2/3]

MSLaneChangerSublane::MSLaneChangerSublane ( )
private

Default constructor.

◆ MSLaneChangerSublane() [3/3]

MSLaneChangerSublane::MSLaneChangerSublane ( const MSLaneChangerSublane )
private

Copy constructor.

Member Function Documentation

◆ abortLCManeuver()

void MSLaneChangerSublane::abortLCManeuver ( MSVehicle vehicle)
protected

◆ addOutsideLeaders()

◆ applyTraCICommands()

bool MSLaneChanger::applyTraCICommands ( MSVehicle vehicle)
protectedinherited

Execute TraCI LC-commands.

Note
This is currently only used within non-actionsteps for the non-sublane model.
Returns
whether lane was changed

Definition at line 425 of file MSLaneChanger.cpp.

References MSLaneChanger::continueChange(), MSVehicle::getLaneChangeModel(), MSAbstractLaneChangeModel::getOwnState(), LCA_BLOCKED, LCA_LEFT, LCA_RIGHT, MSLaneChanger::myCandi, and MSAbstractLaneChangeModel::startLaneChangeManeuver().

Referenced by MSLaneChanger::change().

Here is the caller graph for this function:

◆ avoidDeadlock()

bool MSLaneChanger::avoidDeadlock ( MSVehicle vehicle,
std::pair< MSVehicle *, double >  neighLead,
std::pair< MSVehicle *, double >  overtaken,
std::pair< MSVehicle *, double >  leader 
)
protectedinherited

avoid opposite-diretion deadlock when vehicles are stopped on both sides of the road The method may call saveBlockerLength to affect vehicle speed in the next step

Definition at line 1630 of file MSLaneChanger.cpp.

References DEBUG_COND, MSVehicle::getBestLanes(), MSVehicle::getBestLanesContinuation(), MSVehicle::getBrakeGap(), Named::getID(), Named::getIDSecure(), MSLane::getIndex(), MSVehicle::getLane(), MSVehicle::getLaneChangeModel(), MSVehicleType::getLengthWithGap(), MSVehicleType::getMinGap(), MSVehicle::getPositionOnLane(), MSBaseVehicle::getVehicleType(), MSBaseVehicle::getWaitingSeconds(), MSAbstractLaneChangeModel::isOpposite(), MAX2(), OPPOSITE_OVERTAKING_DEADLOCK_WAIT, MSAbstractLaneChangeModel::saveBlockerLength(), SIMTIME, and MSLaneChanger::yieldToDeadlockOncoming().

Referenced by MSLaneChanger::changeOpposite().

Here is the caller graph for this function:

◆ change()

bool MSLaneChangerSublane::change ( )
protectedvirtual

Find a new candidate and try to change it.

myAllowsChanging

Reimplemented from MSLaneChanger.

Definition at line 114 of file MSLaneChangerSublane.cpp.

References abortLCManeuver(), MSVehicle::adaptBestLanesOccupation(), MSAbstractLaneChangeModel::alreadyChanged(), MSLaneChanger::changeOpposite(), checkChangeHelper(), MSLaneChanger::checkTraCICommands(), MSAbstractLaneChangeModel::clearNeighbors(), continueChangeSublane(), DEBUG_COND, MSAbstractLaneChangeModel::debugVehicle(), MSAbstractLaneChangeModel::decideDirection(), MSAbstractLaneChangeModel::StateAndDist::dir, MSLaneChanger::findCandidate(), findClosestLeader(), Named::getID(), MSVehicle::getLane(), MSVehicle::getLaneChangeModel(), getLeaders(), MSAbstractLaneChangeModel::getManeuverDist(), MSAbstractLaneChangeModel::getSpeedLat(), MSBaseVehicle::getVClass(), MSLaneChanger::hasOppositeStop(), MSLeaderInfo::hasVehicles(), MSVehicle::influenceChangeDecision(), MSVehicle::isActive(), MSAbstractLaneChangeModel::isChangingLanes(), MSAbstractLaneChangeModel::isOpposite(), MSVehicle::isStoppedOnLane(), MSAbstractLaneChangeModel::StateAndDist::latDist, LCA_BLOCKED, LCA_LEFT, LCA_NONE, LCA_RIGHT, LCA_URGENT, LCA_WANTS_LANECHANGE, MSAbstractLaneChangeModel::StateAndDist::maneuverDist, MSLaneChanger::mayChange(), MSLaneChanger::myCandi, MSLaneChanger::myChanger, MSLaneChanger::myChangeToOpposite, myCheckedChangeOpposite, MSLaneChanger::registerUnchanged(), MSAbstractLaneChangeModel::setOwnState(), SIMTIME, startChangeSublane(), MSAbstractLaneChangeModel::StateAndDist::state, SVC_EMERGENCY, toString(), MSVehicle::updateBestLanes(), MSAbstractLaneChangeModel::updateExpectedSublaneSpeeds(), and MSLaneChanger::veh().

◆ changeOpposite()

bool MSLaneChanger::changeOpposite ( MSVehicle vehicle,
std::pair< MSVehicle *, double >  leader,
MSVehicle lastStopped 
)
protectedinherited

try changing to the opposite direction edge.

Definition at line 1189 of file MSLaneChanger.cpp.

References MSLane::allowsChangingLeft(), MSLane::allowsVehicleClass(), MSLaneChanger::avoidDeadlock(), MSLaneChanger::checkChangeOpposite(), MSLaneChanger::checkOppositeStop(), MSLaneChanger::computeOvertakingTime(), MSLaneChanger::computeSafeOppositeLength(), MSLaneChanger::computeSurplusGap(), DEBUG_COND, MSLane::FOLLOW_ONCOMING, MSLaneChanger::foundHilltop(), gDebugFlag5, MSVehicle::getBackPositionOnLane(), MSVehicle::getBestLanes(), MSVehicle::getBestLanesContinuation(), MSLaneChanger::getBestLanesOpposite(), MSLaneChanger::getColumnleader(), MSLink::getDirection(), Named::getID(), Named::getIDSecure(), MSVehicle::getInfluencer(), MSNet::getInstance(), MSVehicle::getLane(), MSVehicle::getLaneChangeModel(), MSVehicle::Influencer::getLaneTimeLineDuration(), MSLane::getLeader(), MSLane::getLength(), MSVehicleType::getLength(), MSLane::getLinkTo(), MSLaneChanger::getMaxOvertakingSpeed(), MSVehicleType::getMinGap(), MSVehicle::getMutableLane(), MSLaneChanger::getOncomingOppositeVehicle(), MSLaneChanger::getOncomingVehicle(), MSLane::getOpposite(), MSLane::getOppositeFollower(), MSLane::getOppositeLeader(), MSLane::getOppositePos(), MSAbstractLaneChangeModel::getOppositeSafetyFactor(), MSLane::getParallelLane(), MSVehicle::getPosition(), MSVehicle::getPositionOnLane(), MSVehicle::Influencer::getRespectJunctionPriority(), MSVehicle::getSlope(), MSLane::getSpeedLimit(), MSLink::getState(), MSBaseVehicle::getVClass(), MSVehicleType::getVehicleClass(), MSLane::getVehicleMaxSpeed(), MSBaseVehicle::getVehicleType(), MSLink::getViaLaneOrLane(), MSBaseVehicle::getWaitingSeconds(), MSGlobals::gLefthand, MSNet::hasElevation(), MSVehicle::hasInfluencer(), MSLaneChanger::hasOppositeStop(), MSLink::havePriority(), MSLink::haveRed(), MSLink::haveYellow(), MSVehicle::ignoreRed(), MSVehicle::influenceChangeDecision(), MSLane::isInternal(), MSAbstractLaneChangeModel::isOpposite(), MSBaseVehicle::isStopped(), LCA_LEFT, LCA_TRACI, LINKSTATE_ZIPPER, MAX2(), MIN2(), MSLaneChanger::myChangeToOpposite, MSVehicle::nextStopDist(), OPPOSITE_OVERTAKING_DEADLOCK_WAIT, OPPOSITE_OVERTAKING_HILLTOP_THRESHOHOLD, OPPOSITE_OVERTAKING_MAX_SPACE_TO_OVERTAKE, OPPOSITE_OVERTAKING_ONCOMING_LOOKAHEAD, MSLaneChanger::resolveDeadlock(), SIMTIME, STEPS2TIME, STRAIGHT, SVC_EMERGENCY, TIME2STEPS, toString(), TS, MSVehicle::VEH_SIGNAL_BLINKER_LEFT, MSVehicle::VEH_SIGNAL_BLINKER_RIGHT, MSLaneChanger::yieldToOppositeWaiting(), and Position::z().

Referenced by MSLaneChanger::change(), and change().

Here is the caller graph for this function:

◆ checkChange()

int MSLaneChanger::checkChange ( int  laneOffset,
const MSLane targetLane,
const std::pair< MSVehicle *const, double > &  leader,
const std::pair< MSVehicle *const, double > &  follower,
const std::pair< MSVehicle *const, double > &  neighLead,
const std::pair< MSVehicle *const, double > &  neighFollow,
const std::vector< MSVehicle::LaneQ > &  preb 
) const
protectedinherited

Definition at line 744 of file MSLaneChanger.cpp.

References ACCEL2SPEED, MSCFModel::brakeGap(), MSAbstractLaneChangeModel::checkChangeBeforeCommitting(), DEBUG_COND, DELTA_T, MSAbstractLaneChangeModel::estimateLCDuration(), MSVehicle::getAcceleration(), MSVehicle::getActionStepLength(), MSAbstractLaneChangeModel::getAssumedDecelForLaneChangeDuration(), MSVehicle::getBackPositionOnLane(), MSVehicle::getBestLanesContinuation(), MSVehicle::getCarFollowModel(), MSLane::getCriticalLeader(), MSLane::getEdge(), MSCFModel::getHeadwayTime(), Named::getID(), MSVehicle::getLane(), MSVehicle::getLaneChangeModel(), MSLane::getLeader(), MSLane::getLength(), MSVehicleType::getLengthWithGap(), MSCFModel::getMaxDecel(), MSVehicleType::getMinGap(), MSLane::getParallelLane(), MSVehicle::getPositionOnLane(), MSVehicle::getRightSideOnLane(), MSAbstractLaneChangeModel::getSafetyFactor(), MSCFModel::getSecureGap(), MSVehicle::getSpeed(), MSBaseVehicle::getVehicleType(), MSLane::getWidth(), MSVehicleType::getWidth(), MSGlobals::gLaneChangeDuration, MSLane::hasPedestrians(), MSVehicle::influenceChangeDecision(), MSEdge::isInternal(), MSLane::isLinkEnd(), MSAbstractLaneChangeModel::isOpposite(), LCA_BLOCKED, LCA_BLOCKED_BY_LEFT_FOLLOWER, LCA_BLOCKED_BY_LEFT_LEADER, LCA_BLOCKED_BY_RIGHT_FOLLOWER, LCA_BLOCKED_BY_RIGHT_LEADER, LCA_INSUFFICIENT_SPACE, LCA_INSUFFICIENT_SPEED, LCA_OVERLAPPING, LCA_URGENT, LCA_WANTS_LANECHANGE, LEFT, MAX2(), MIN2(), MSLaneChanger::myCandi, MSLane::nextBlocking(), MSAbstractLaneChangeModel::NO_NEIGHBOR, RIGHT, MSAbstractLaneChangeModel::saveLCState(), MSAbstractLaneChangeModel::saveNeighbors(), MSAbstractLaneChangeModel::setFollowerGaps(), MSAbstractLaneChangeModel::setLeaderGaps(), MSAbstractLaneChangeModel::setOrigLeaderGaps(), SIMTIME, MSLane::succLinkSec(), toString(), TS, MSVehicle::unsafeLinkAhead(), MSLaneChanger::veh(), and MSAbstractLaneChangeModel::wantsChange().

Referenced by MSLaneChanger::checkChangeOpposite(), and MSLaneChanger::checkChangeWithinEdge().

Here is the caller graph for this function:

◆ checkChangeHelper()

MSLaneChangerSublane::StateAndDist MSLaneChangerSublane::checkChangeHelper ( MSVehicle vehicle,
int  laneOffset,
LaneChangeAction  alternatives 
)
protected

◆ checkChangeOpposite()

bool MSLaneChangerSublane::checkChangeOpposite ( MSVehicle vehicle,
int  laneOffset,
MSLane targetLane,
const std::pair< MSVehicle *const, double > &  leader,
const std::pair< MSVehicle *const, double > &  neighLead,
const std::pair< MSVehicle *const, double > &  neighFollow,
const std::vector< MSVehicle::LaneQ > &  preb 
)
protectedvirtual

◆ checkChangeSublane()

int MSLaneChangerSublane::checkChangeSublane ( int  laneOffset,
LaneChangeAction  alternatives,
const std::vector< MSVehicle::LaneQ > &  preb,
double &  latDist,
double &  maneuverDist 
) const
protected

check whether sub-lane changing in the given direction is desirable and possible

Parameters
[in]laneOffsetThe direction in which changing should be checked
[in]leadersThe candidate vehicle's leaders
[in]prebThe bestLanse of the candidaet vehicle
[out]latDistThe distance by which the vehicle changes laterally
[out]maneuverDistThe lateral distance for the complete envisioned maneuver (used for maneuver continuation in non-actionsteps).

Definition at line 645 of file MSLaneChangerSublane.cpp.

References MSLeaderDistanceInfo::addLeaders(), addOutsideLeaders(), DEBUG_COND, MSVehicle::getBackPositionOnLane(), Named::getID(), MSVehicle::getLane(), MSVehicle::getLaneChangeModel(), MSLane::getRightSideOnEdge(), MSLane::getWidth(), MSLeaderInfo::hasVehicles(), MSVehicle::influenceChangeDecision(), MSLeaderDistanceInfo::moveSamePosTo(), MSLaneChanger::myCandi, MSAbstractLaneChangeModel::saveLCState(), MSAbstractLaneChangeModel::saveNeighbors(), SIMTIME, MSLeaderDistanceInfo::toString(), toString(), MSLaneChanger::veh(), and MSAbstractLaneChangeModel::wantsChangeSublane().

Referenced by checkChangeHelper().

Here is the caller graph for this function:

◆ checkChangeToNewLane()

bool MSLaneChangerSublane::checkChangeToNewLane ( MSVehicle vehicle,
const int  direction,
ChangerIt  from,
ChangerIt  to 
)
protected

◆ checkChangeWithinEdge()

int MSLaneChanger::checkChangeWithinEdge ( int  laneOffset,
const std::pair< MSVehicle *const, double > &  leader,
const std::vector< MSVehicle::LaneQ > &  preb 
) const
protectedinherited

Definition at line 726 of file MSLaneChanger.cpp.

References MSLaneChanger::checkChange(), MSLaneChanger::getRealFollower(), MSLaneChanger::getRealLeader(), and MSLaneChanger::myCandi.

Referenced by MSLaneChanger::change().

Here is the caller graph for this function:

◆ checkOppositeStop()

◆ checkTraCICommands()

void MSLaneChanger::checkTraCICommands ( MSVehicle vehicle)
protectedinherited

Take into account traci LC-commands.

Note
This is currently only used within non-actionsteps.

Definition at line 404 of file MSLaneChanger.cpp.

References MSAbstractLaneChangeModel::checkTraCICommands(), DEBUG_COND, Named::getID(), MSVehicle::getLaneChangeModel(), MSAbstractLaneChangeModel::getOwnState(), LCA_BLOCKED, LCA_OVERLAPPING, SIMTIME, and toString().

Referenced by MSLaneChanger::change(), and change().

Here is the caller graph for this function:

◆ computeOvertakingTime()

void MSLaneChanger::computeOvertakingTime ( const MSVehicle vehicle,
double  vMax,
const MSVehicle leader,
double  gap,
double &  timeToOvertake,
double &  spaceToOvertake 
)
staticprotectedinherited

Compute the time and space required for overtaking the given leader.

Parameters
[in]vehicleThe vehicle that wants to overtake
[in]leaderThe vehicle to be overtaken
[in]gapThe gap between vehicle and leader
[out]timeToOvertakeThe time for overtaking
[out]spaceToOvertakeThe space for overtaking

XXX ignore speed limit when overtaking through the opposite lane?

Definition at line 2196 of file MSLaneChanger.cpp.

References DEBUG_COND, MSVehicle::getAcceleration(), MSVehicle::getCarFollowModel(), MSVehicle::getLane(), MSVehicle::getLaneChangeModel(), MSVehicleType::getLength(), MSVehicleType::getLengthWithGap(), MSCFModel::getMaxAccel(), MSCFModel::getMaxDecel(), MSVehicleType::getMaxSpeedLat(), MSVehicleType::getMinGap(), MSAbstractLaneChangeModel::getOppositeSafetyFactor(), MSCFModel::getSecureGap(), MSVehicle::getSpeed(), MSBaseVehicle::getStopDuration(), MSLane::getVehicleMaxSpeed(), MSBaseVehicle::getVehicleType(), MSLane::getWidth(), MSGlobals::gSublane, MAX2(), OPPOSITE_OVERTAKING_SAFE_TIMEGAP, OPPOSITE_OVERTAKING_SAFETY_FACTOR, STEPS2TIME, and TS.

Referenced by MSLaneChanger::changeOpposite().

Here is the caller graph for this function:

◆ computeSafeOppositeLength()

double MSLaneChanger::computeSafeOppositeLength ( MSVehicle vehicle,
double  oppositeLength,
const MSLane source,
double  usableDist,
std::pair< MSVehicle *, double >  oncoming,
double  vMax,
double  oncomingSpeed,
std::pair< MSVehicle *, double >  neighLead,
std::pair< MSVehicle *, double >  overtaken,
std::pair< MSVehicle *, double >  neighFollow,
double  surplusGap,
const MSLane opposite,
bool  canOvertake 
)
protectedinherited

◆ computeSurplusGap()

double MSLaneChanger::computeSurplusGap ( const MSVehicle vehicle,
const MSLane opposite,
std::pair< MSVehicle *, double >  oncoming,
double  timeToOvertake,
double  spaceToOvertake,
double &  oncomingSpeed,
bool  oncomingOpposite = false 
)
staticprotectedinherited

◆ continueChange()

bool MSLaneChanger::continueChange ( MSVehicle vehicle,
ChangerIt from 
)
protectedinherited

◆ continueChangeSublane()

bool MSLaneChangerSublane::continueChangeSublane ( MSVehicle vehicle,
ChangerIt from 
)
protected

Continue a sublane-lane change maneuver and return whether the midpoint was passed in this step.

Definition at line 318 of file MSLaneChangerSublane.cpp.

References MSAbstractLaneChangeModel::computeSpeedLat(), DEBUG_COND, Named::getID(), MSVehicle::getLaneChangeModel(), MSAbstractLaneChangeModel::getManeuverDist(), MSAbstractLaneChangeModel::getOwnState(), LCA_URGENT, SIMTIME, SPEED2DIST, and startChangeSublane().

Referenced by change().

Here is the caller graph for this function:

◆ findCandidate()

MSLaneChanger::ChangerIt MSLaneChanger::findCandidate ( )
protectedinherited

Find current candidate. If there is none, myChanger.end() is returned.

Definition at line 217 of file MSLaneChanger.cpp.

References Named::getID(), MSVehicle::getPositionOnLane(), MSVehicle::isFrontOnLane(), MSLaneChanger::myChanger, SIMTIME, and MSLaneChanger::veh().

Referenced by MSLaneChanger::change(), and change().

Here is the caller graph for this function:

◆ findClosestLeader()

std::pair< MSVehicle *, double > MSLaneChangerSublane::findClosestLeader ( const MSLeaderDistanceInfo leaders,
const MSVehicle vehicle 
)
staticprotected

find the closest leader that prevents ego vehicle from passing on the current lane

Definition at line 855 of file MSLaneChangerSublane.cpp.

References MSVehicle::getLane(), MSVehicleType::getMinGapLat(), MSBaseVehicle::getVehicleType(), MSLane::getWidth(), MSVehicleType::getWidth(), and MSLeaderInfo::numSublanes().

Referenced by change().

Here is the caller graph for this function:

◆ foundHilltop()

bool MSLaneChanger::foundHilltop ( MSVehicle vehicle,
bool  foundHill,
double  searchDist,
const std::vector< MSLane * > &  bestLanes,
int  view,
double  pos,
double  lastMax,
double  hilltopThreshold 
)
staticprotectedinherited

Definition at line 2101 of file MSLaneChanger.cpp.

References DEBUG_COND, MSLaneChanger::foundHilltop(), Named::getID(), MSLane::getShape(), MSLane::interpolateGeometryPosToLanePos(), and SIMTIME.

Referenced by MSLaneChanger::changeOpposite(), and MSLaneChanger::foundHilltop().

Here is the caller graph for this function:

◆ getBestLanesOpposite()

std::vector< MSVehicle::LaneQ > MSLaneChanger::getBestLanesOpposite ( MSVehicle vehicle,
const MSLane stopLane,
double  oppositeLength 
)
staticprotectedinherited

◆ getChanger()

Changer & MSLaneChanger::getChanger ( )
inlineinherited

return changer (only to be used by MSLaneChangerSublane from another instance)

Definition at line 117 of file MSLaneChanger.h.

References MSLaneChanger::myChanger.

Referenced by startChangeSublane().

Here is the caller graph for this function:

◆ getCloserFollower()

MSVehicle * MSLaneChanger::getCloserFollower ( const double  maxPos,
MSVehicle follow1,
MSVehicle follow2 
)
staticprotectedinherited

return the closer follower of ego

Definition at line 711 of file MSLaneChanger.cpp.

References MSVehicle::getPositionOnLane().

Referenced by MSLaneChanger::getRealFollower().

Here is the caller graph for this function:

◆ getColumnleader()

std::pair< MSVehicle *, double > MSLaneChanger::getColumnleader ( double &  maxSpace,
MSVehicle vehicle,
std::pair< MSVehicle *, double >  leader,
double  maxLookAhead = std::numeric_limits<double>::max() 
)
staticprotectedinherited

return leader vehicle that is to be overtaken

Parameters
[out]maxSpaceThe maxium space that can be used for the overtaking maneuver (limits speed)
[in]vehicleThe vehicle that wants to overtake
[in]leaderThe vehicle to be overtaken and the gap to this vehicle
[in]maxLookAheadThe maximum lookahead distance

This methods calls itself recursively to find the leader of a column of vehicles to be overtaken (if there is no sufficient gap for stopping in between)

Definition at line 2319 of file MSLaneChanger.cpp.

References MSCFModel::brakeGap(), DEBUG_COND, MSVehicle::getBackPositionOnLane(), MSVehicle::getBestLanesContinuation(), MSVehicle::getCarFollowModel(), MSLaneChanger::getColumnleader(), MSLane::getEdge(), Named::getID(), Named::getIDSecure(), MSVehicle::getLane(), MSLaneChanger::getLaneAfter(), MSVehicle::getLaneChangeModel(), MSLane::getLastAnyVehicle(), MSLane::getLength(), MSVehicleType::getLengthWithGap(), MSCFModel::getMaxDecel(), MSAbstractLaneChangeModel::getOppositeSafetyFactor(), MSVehicle::getPositionOnLane(), MSCFModel::getSecureGap(), MSVehicle::getSpeed(), MSVehicleType::getVehicleClass(), MSLane::getVehicleMaxSpeed(), MSBaseVehicle::getVehicleType(), MAX2(), OPPOSITE_OVERTAKING_MAX_LOOKAHEAD, OPPOSITE_OVERTAKING_MAX_LOOKAHEAD_EMERGENCY, OPPOSITE_OVERTAKING_SAFETY_FACTOR, SVC_EMERGENCY, and toString().

Referenced by MSLaneChanger::changeOpposite(), and MSLaneChanger::getColumnleader().

Here is the caller graph for this function:

◆ getLaneAfter()

const MSLane * MSLaneChanger::getLaneAfter ( const MSLane lane,
const std::vector< MSLane * > &  conts,
bool  allowMinor,
bool &  contsEnd 
)
staticprotectedinherited

return the next lane in conts beyond lane or nullptr

Definition at line 2508 of file MSLaneChanger.cpp.

References MSLane::getLinkTo(), and MSLink::havePriority().

Referenced by MSLaneChanger::getColumnleader().

Here is the caller graph for this function:

◆ getLeaders()

MSLeaderDistanceInfo MSLaneChangerSublane::getLeaders ( const ChangerIt target,
const MSVehicle ego 
) const
protected

◆ getMaxOvertakingSpeed()

double MSLaneChanger::getMaxOvertakingSpeed ( const MSVehicle vehicle,
double  maxSpaceToOvertake 
)
staticprotectedinherited

compute maximum maneuver speed

Definition at line 2529 of file MSLaneChanger.cpp.

References MSVehicle::getCarFollowModel(), MSCFModel::getMaxAccel(), and MSCFModel::getMaxDecel().

Referenced by MSLaneChanger::changeOpposite().

Here is the caller graph for this function:

◆ getOncomingOppositeVehicle()

std::pair< MSVehicle *const, double > MSLaneChanger::getOncomingOppositeVehicle ( const MSVehicle vehicle,
std::pair< MSVehicle *, double >  overtaken,
double  searchDist 
)
protectedinherited

Definition at line 2022 of file MSLaneChanger.cpp.

References gDebugFlag5, MSVehicle::getBestLanesContinuation(), Named::getID(), Named::getIDSecure(), MSVehicle::getLane(), MSLane::getLeader(), MSVehicleType::getLengthWithGap(), MSVehicle::getPositionOnLane(), MSBaseVehicle::getVehicleType(), and SIMTIME.

Referenced by MSLaneChanger::changeOpposite(), and MSLaneChanger::resolveDeadlock().

Here is the caller graph for this function:

◆ getOncomingVehicle()

std::pair< MSVehicle *const, double > MSLaneChanger::getOncomingVehicle ( const MSLane opposite,
std::pair< MSVehicle *, double >  neighOncoming,
double  searchDist,
double &  vMax,
const MSVehicle overtaken = nullptr,
MSLane::MinorLinkMode  mLinkMode = MSLane::MinorLinkMode::FOLLOW_NEVER 
)
protectedinherited

Definition at line 1983 of file MSLaneChanger.cpp.

References gDebugFlag5, MSLane::getFollower(), MAX2(), MIN2(), and SIMTIME.

Referenced by MSLaneChanger::changeOpposite(), and MSLaneChanger::checkOppositeStop().

Here is the caller graph for this function:

◆ getRealFollower()

std::pair< MSVehicle *const, double > MSLaneChanger::getRealFollower ( const ChangerIt target) const
protectedinherited

Definition at line 633 of file MSLaneChanger.cpp.

References DEBUG_COND, MSVehicle::getBackPositionOnLane(), MSLaneChanger::getCloserFollower(), Named::getID(), MSVehicleType::getLength(), MSVehicleType::getMinGap(), MSVehicle::getPositionOnLane(), MSBaseVehicle::getVehicleType(), MSLaneChanger::myCandi, SIMTIME, and MSLaneChanger::veh().

Referenced by MSLaneChanger::checkChangeWithinEdge().

Here is the caller graph for this function:

◆ getRealLeader()

std::pair< MSVehicle *const, double > MSLaneChanger::getRealLeader ( const ChangerIt target) const
protectedinherited

◆ hasOppositeStop()

bool MSLaneChanger::hasOppositeStop ( MSVehicle vehicle)
staticprotectedinherited

whether vehicle has an opposite-direction stop within relevant range

Definition at line 1083 of file MSLaneChanger.cpp.

References MSBaseVehicle::getNextStop(), MSBaseVehicle::hasStops(), MSStop::isOpposite, MSVehicle::nextStopDist(), and OPPOSITE_OVERTAKING_MAX_LOOKAHEAD.

Referenced by MSLaneChanger::change(), change(), and MSLaneChanger::changeOpposite().

Here is the caller graph for this function:

◆ initChanger()

void MSLaneChangerSublane::initChanger ( )
protectedvirtual

Initialize the changer before looping over all vehicles.

Reimplemented from MSLaneChanger.

Definition at line 73 of file MSLaneChangerSublane.cpp.

References MSLaneChanger::initChanger(), and MSLaneChanger::myChanger.

◆ laneChange()

void MSLaneChanger::laneChange ( SUMOTime  t)
inherited

Start lane-change-process for all vehicles on the edge'e lanes.

Definition at line 141 of file MSLaneChanger.cpp.

References MSLaneChanger::change(), MSLaneChanger::initChanger(), MSLaneChanger::myChanger, MSLaneChanger::updateChanger(), MSLaneChanger::updateLanes(), and MSLaneChanger::vehInChanger().

Referenced by MSEdge::changeLanes().

Here is the caller graph for this function:

◆ mayChange()

bool MSLaneChanger::mayChange ( int  direction) const
protectedinherited

whether changing to the lane in the given direction should be considered

Definition at line 256 of file MSLaneChanger.cpp.

References MSBaseVehicle::getVClass(), MSLaneChanger::myAllowsChanging, MSLaneChanger::myCandi, and MSLaneChanger::veh().

Referenced by MSLaneChanger::change(), change(), checkChangeHelper(), checkChangeOpposite(), checkChangeToNewLane(), and startChangeSublane().

Here is the caller graph for this function:

◆ operator=()

MSLaneChangerSublane & MSLaneChangerSublane::operator= ( const MSLaneChangerSublane )
private

Assignment operator.

◆ outputLCEnded()

void MSLaneChangerSublane::outputLCEnded ( MSVehicle vehicle,
ChangerIt from,
ChangerIt to,
int  direction 
)
protected

◆ outputLCStarted()

void MSLaneChangerSublane::outputLCStarted ( MSVehicle vehicle,
ChangerIt from,
ChangerIt to,
int  direction,
double  maneuverDist 
)
protected

◆ registerUnchanged()

void MSLaneChanger::registerUnchanged ( MSVehicle vehicle)
protectedinherited

Update changer for vehicles that did not change

Definition at line 394 of file MSLaneChanger.cpp.

References MSVehicle::getLaneChangeModel(), MSVehicleType::getLengthWithGap(), MSBaseVehicle::getVehicleType(), MSLaneChanger::myCandi, MSAbstractLaneChangeModel::unchanged(), and MSLaneChanger::veh().

Referenced by MSLaneChanger::change(), change(), and MSLaneChanger::startChange().

Here is the caller graph for this function:

◆ resolveDeadlock()

bool MSLaneChanger::resolveDeadlock ( MSVehicle vehicle,
std::pair< MSVehicle *const, double >  leader,
std::pair< MSVehicle *, double >  neighLead,
std::pair< MSVehicle *, double >  overtaken 
)
protectedinherited

keep stopping to resolve opposite-diretion deadlock while there is oncoming traffic The method may call saveBlockerLength to affect vehicle speed in the next step

Definition at line 1799 of file MSLaneChanger.cpp.

References DEBUG_COND, MSVehicle::getBestLanes(), Named::getID(), Named::getIDSecure(), MSLane::getIndex(), MSVehicle::getLane(), MSVehicle::getLaneChangeModel(), MSVehicleType::getLengthWithGap(), MSVehicleType::getMinGap(), MSLaneChanger::getOncomingOppositeVehicle(), MSVehicle::getPositionOnLane(), MSBaseVehicle::getVehicleType(), MSBaseVehicle::getWaitingSeconds(), OPPOSITE_OVERTAKING_DEADLOCK_WAIT, MSAbstractLaneChangeModel::saveBlockerLength(), SIMTIME, UNUSED_PARAMETER, and MSLaneChanger::yieldToDeadlockOncoming().

Referenced by MSLaneChanger::changeOpposite().

Here is the caller graph for this function:

◆ startChange()

bool MSLaneChanger::startChange ( MSVehicle vehicle,
ChangerIt from,
int  direction 
)
protectedinherited

Definition at line 447 of file MSLaneChanger.cpp.

References MSLaneChanger::continueChange(), MSVehicle::getLaneChangeModel(), MSVehicle::isRemoteControlled(), MSLaneChanger::myCandi, MSLaneChanger::registerUnchanged(), and MSAbstractLaneChangeModel::startLaneChangeManeuver().

Referenced by MSLaneChanger::change().

Here is the caller graph for this function:

◆ startChangeSublane()

bool MSLaneChangerSublane::startChangeSublane ( MSVehicle vehicle,
ChangerIt from,
double  latDist,
double  maneuverDist 
)
protected

change by the specified amount and return whether a new lane was entered

Definition at line 340 of file MSLaneChangerSublane.cpp.

References abortLCManeuver(), checkChangeToNewLane(), MSVehicle::computeAngle(), DEBUG_COND, DELTA_T, DIST2SPEED, MSVehicle::getActionStepLength(), MSVehicle::getActionStepLengthSecs(), MSVehicle::getAngle(), MSLaneChanger::getChanger(), MSAbstractLaneChangeModel::getCommittedSpeed(), MSLane::getEdge(), Named::getID(), Named::getIDSecure(), MSLane::getIndex(), MSVehicle::getInfluencer(), MSVehicle::getLane(), MSVehicle::getLaneChangeModel(), MSVehicle::getLateralPositionOnLane(), MSVehicle::getLatOffset(), MSAbstractLaneChangeModel::getManeuverDist(), MSVehicleType::getMaxSpeedLat(), MSLane::getOpposite(), MSAbstractLaneChangeModel::getOwnState(), MSAbstractLaneChangeModel::getPreviousManeuverDist(), MSAbstractLaneChangeModel::getPrevState(), MSLane::getRightSideOnEdge(), MSAbstractLaneChangeModel::getShadowLane(), MSBaseVehicle::getVehicleType(), MSBaseVehicle::getWidth(), MSLane::getWidth(), Position::INVALID, MSAbstractLaneChangeModel::isOpposite(), MSVehicle::isRemoteControlled(), LCA_CHANGE_REASONS, LCA_TRACI, M_PI, MSLaneChanger::mayChange(), MSVehicle::myCachedPosition, MSLaneChanger::myChanger, MSVehicle::myFurtherLanesPosLat, MSEdge::myLaneChanger, MSVehicle::State::myPosLat, MSVehicle::myState, outputLCEnded(), outputLCStarted(), RAD2DEG, MSVehicle::setAngle(), MSAbstractLaneChangeModel::setManeuverDist(), MSAbstractLaneChangeModel::setSpeedLat(), MSVehicle::Influencer::setSublaneChange(), SIMTIME, std::swap(), toString(), MSAbstractLaneChangeModel::updateSafeLatDist(), MSAbstractLaneChangeModel::updateShadowLane(), and MSAbstractLaneChangeModel::updateTargetLane().

Referenced by change(), checkChangeOpposite(), and continueChangeSublane().

Here is the caller graph for this function:

◆ updateChanger()

◆ updateLanes()

void MSLaneChanger::updateLanes ( SUMOTime  t)
protectedinherited

During lane-change a temporary vehicle container is filled within the lanes (bad practice to modify foreign members, I know). Swap this container with the real one.

Definition at line 199 of file MSLaneChanger.cpp.

References MSLaneChanger::myChanger.

Referenced by MSLaneChanger::laneChange().

Here is the caller graph for this function:

◆ veh()

MSVehicle * MSLaneChanger::veh ( ConstChangerIt  ce) const
inlineprotectedinherited

Returns the furthes unhandled vehicle on this change-elements lane or 0 if there is none.

Definition at line 141 of file MSLaneChanger.h.

Referenced by MSLaneChanger::change(), change(), MSLaneChanger::checkChange(), checkChangeSublane(), MSLaneChanger::findCandidate(), getLeaders(), MSLaneChanger::getRealFollower(), MSLaneChanger::getRealLeader(), MSLaneChanger::mayChange(), MSLaneChanger::registerUnchanged(), MSLaneChanger::updateChanger(), and MSLaneChanger::vehInChanger().

Here is the caller graph for this function:

◆ vehInChanger()

bool MSLaneChanger::vehInChanger ( ) const
inlineprotectedinherited

Check if there is a single change-candidate in the changer. Returns true if there is one.

Definition at line 128 of file MSLaneChanger.h.

References MSLaneChanger::myChanger, and MSLaneChanger::veh().

Referenced by MSLaneChanger::laneChange().

Here is the caller graph for this function:

◆ yieldToDeadlockOncoming()

bool MSLaneChanger::yieldToDeadlockOncoming ( const MSVehicle vehicle,
const MSVehicle stoppedNeigh,
double  dist 
)
protectedinherited

check whether to keep stopping for oncoming vehicles in the deadlock zone

Definition at line 1748 of file MSLaneChanger.cpp.

References DEBUG_COND, MSVehicle::getFollower(), Named::getID(), Named::getIDSecure(), MSVehicleType::getLengthWithGap(), MSBaseVehicle::getVehicleType(), MSBaseVehicle::getWaitingSeconds(), OPPOSITE_OVERTAKING_DEADLOCK_WAIT, and SIMTIME.

Referenced by MSLaneChanger::avoidDeadlock(), and MSLaneChanger::resolveDeadlock().

Here is the caller graph for this function:

◆ yieldToOppositeWaiting()

bool MSLaneChanger::yieldToOppositeWaiting ( const MSVehicle vehicle,
const MSVehicle stoppedNeigh,
double  dist,
SUMOTime  deltaWait = 0 
)
protectedinherited

check whether to yield for oncoming vehicles that have waited longer for opposite overtaking

Definition at line 1776 of file MSLaneChanger.cpp.

References DEBUG_COND, MSVehicle::getFollower(), Named::getID(), MSBaseVehicle::getWaitingSeconds(), MSVehicle::getWaitingTime(), SIMTIME, and STEPS2TIME.

Referenced by MSLaneChanger::changeOpposite(), and MSLaneChanger::computeSafeOppositeLength().

Here is the caller graph for this function:

Field Documentation

◆ myAllowsChanging

const bool MSLaneChanger::myAllowsChanging
protectedinherited

Definition at line 320 of file MSLaneChanger.h.

Referenced by MSLaneChanger::change(), and MSLaneChanger::mayChange().

◆ myCandi

◆ myChanger

◆ myChangeToOpposite

const bool MSLaneChanger::myChangeToOpposite
protectedinherited

whether this edge allows changing to the opposite direction edge

Definition at line 323 of file MSLaneChanger.h.

Referenced by change(), and MSLaneChanger::changeOpposite().

◆ myCheckedChangeOpposite

bool MSLaneChangerSublane::myCheckedChangeOpposite
protected

whether checkChangeOpposite was called for the current vehicle

Definition at line 118 of file MSLaneChangerSublane.h.

Referenced by change(), and checkChangeOpposite().


The documentation for this class was generated from the following files: