Eclipse SUMO - Simulation of Urban MObility
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. More...
 
typedef Changer::iterator ChangerIt
 the iterator moving over the ChangeElems More...
 
typedef Changer::const_iterator ConstChangerIt
 the iterator moving over the ChangeElems More...
 

Public Member Functions

void laneChange (SUMOTime t)
 Start lane-change-process for all vehicles on the edge'e lanes. More...
 
 MSLaneChangerSublane (const std::vector< MSLane * > *lanes, bool allowChanging)
 Constructor. More...
 
 ~MSLaneChangerSublane ()
 Destructor. More...
 

Protected Types

typedef MSAbstractLaneChangeModel::StateAndDist StateAndDist
 

Protected Member Functions

void abortLCManeuver (MSVehicle *vehicle)
 immediately stop lane-changing and register vehicle as unchanged More...
 
bool applyTraCICommands (MSVehicle *vehicle)
 Execute TraCI LC-commands. More...
 
virtual bool change ()
 
virtual bool changeOpposite (std::pair< MSVehicle *, double > leader)
 
int checkChange (int laneOffset, const 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) const
 
StateAndDist checkChangeHelper (MSVehicle *vehicle, int laneOffset, LaneChangeAction alternatives)
 helper function that calls checkChangeSublane and sets blocker information More...
 
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 More...
 
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 More...
 
int checkChangeWithinEdge (int laneOffset, const std::pair< MSVehicle *const, double > &leader, const std::vector< MSVehicle::LaneQ > &preb) const
 
void checkTraCICommands (MSVehicle *vehicle)
 Take into account traci LC-commands. More...
 
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) More...
 
bool continueChangeSublane (MSVehicle *vehicle, ChangerIt &from)
 Continue a sublane-lane change maneuver and return whether the midpoint was passed in this step. More...
 
ChangerIt findCandidate ()
 Find current candidate. If there is none, myChanger.end() is returned. More...
 
MSLeaderDistanceInfo getLeaders (const ChangerIt &target, const MSVehicle *ego) const
 get leaders for ego on the given lane More...
 
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. More...
 
bool mayChange (int direction) const
 whether changing to the lane in the given direction should be considered More...
 
void outputLCEnded (MSVehicle *vehicle, ChangerIt &from, ChangerIt &to, int direction)
 optional output for end of lane-change maneuvre More...
 
void outputLCStarted (MSVehicle *vehicle, ChangerIt &from, ChangerIt &to, int direction, double maneuverDist)
 optional output for start of lane-change maneuvre More...
 
void registerUnchanged (MSVehicle *vehicle)
 
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 More...
 
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. More...
 

Static Protected Member Functions

static void computeOvertakingTime (const MSVehicle *vehicle, const MSVehicle *leader, double gap, double &timeToOvertake, double &spaceToOvertake)
 Compute the time and space required for overtaking the given leader. More...
 
static MSVehiclegetCloserFollower (const double maxPos, MSVehicle *follow1, MSVehicle *follow2)
 return the closer follower of ego More...
 
static std::pair< MSVehicle *, double > getColumnleader (MSVehicle *vehicle, std::pair< MSVehicle *, double > leader, double maxLookAhead=std::numeric_limits< double >::max())
 
static MSLanegetLaneAfter (const MSLane *lane, const std::vector< MSLane * > &conts)
 return the next lane in conts beyond lane or nullptr More...
 

Protected Attributes

const bool myAllowsChanging
 
ChangerIt myCandi
 
Changer myChanger
 Container for ChangeElemements, one for every lane in the edge. More...
 
const bool myChangeToOpposite
 whether this edge allows changing to the opposite direction edge More...
 

Private Member Functions

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

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 103 of file MSLaneChanger.h.

◆ ChangerIt

typedef Changer::iterator MSLaneChanger::ChangerIt
inherited

the iterator moving over the ChangeElems

Definition at line 106 of file MSLaneChanger.h.

◆ ConstChangerIt

typedef Changer::const_iterator MSLaneChanger::ConstChangerIt
inherited

the iterator moving over the ChangeElems

Definition at line 109 of file MSLaneChanger.h.

◆ StateAndDist

Constructor & Destructor Documentation

◆ MSLaneChangerSublane() [1/3]

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

Constructor.

Definition at line 52 of file MSLaneChangerSublane.cpp.

References MSLaneChanger::myChanger.

◆ ~MSLaneChangerSublane()

MSLaneChangerSublane::~MSLaneChangerSublane ( )

Destructor.

Definition at line 68 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

immediately stop lane-changing and register vehicle as unchanged

Definition at line 207 of file MSLaneChangerSublane.cpp.

References DEBUG_COND, Named::getID(), MSVehicle::getLaneChangeModel(), MSAbstractLaneChangeModel::getOwnState(), MSAbstractLaneChangeModel::getPreviousManeuverDist(), MSAbstractLaneChangeModel::getPrevState(), LCA_CHANGE_REASONS, LCA_SUBLANE, MSLaneChanger::myCandi, outputLCEnded(), MSLaneChanger::registerUnchanged(), MSAbstractLaneChangeModel::setManeuverDist(), MSAbstractLaneChangeModel::setSpeedLat(), SIMTIME, and toString().

Referenced by change(), and startChangeSublane().

Here is the caller graph for this function:

◆ 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 400 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:

◆ change()

◆ changeOpposite()

bool MSLaneChanger::changeOpposite ( std::pair< MSVehicle *, double >  leader)
protectedvirtualinherited

try changing to the opposite direction edge.

Definition at line 1012 of file MSLaneChanger.cpp.

References MSLane::allowsVehicleClass(), MSLaneChanger::checkChange(), MSLaneChanger::computeOvertakingTime(), MSLaneChanger::continueChange(), DEBUG_COND, MSLaneChanger::findCandidate(), MSVehicle::getAcceleration(), MSVehicle::getBestLanes(), MSVehicle::getBestLanesContinuation(), MSVehicle::getCarFollowModel(), MSLaneChanger::getColumnleader(), MSLink::getDirection(), MSCFModel::getHeadwayTime(), Named::getID(), Named::getIDSecure(), MSVehicle::getInfluencer(), MSVehicle::getLane(), MSVehicle::getLaneChangeModel(), MSVehicle::Influencer::getLaneTimeLineDuration(), MSLane::getLength(), MSLane::getLinkTo(), MSAbstractLaneChangeModel::getModelID(), MSVehicle::getMutableLane(), MSLane::getOpposite(), MSLane::getOppositeFollower(), MSLane::getOppositeLeader(), MSLane::getOppositePos(), MSVehicle::getPositionOnLane(), MSVehicle::Influencer::getRespectJunctionPriority(), MSVehicle::getSpeed(), MSLane::getSpeedLimit(), MSLink::getState(), MSBaseVehicle::getVClass(), MSVehicleType::getVehicleClass(), MSLane::getVehicleMaxSpeed(), MSBaseVehicle::getVehicleType(), MSLink::getViaLaneOrLane(), MSGlobals::gLefthand, MSVehicle::hasInfluencer(), MSLink::havePriority(), MSLink::haveRed(), MSLink::haveYellow(), MSVehicle::ignoreRed(), MSVehicle::influenceChangeDecision(), MSAbstractLaneChangeModel::isOpposite(), MSBaseVehicle::isStopped(), LCA_BLOCKED, LCA_COOPERATIVE, LCA_LEFT, LCA_TRACI, LCA_WANTS_LANECHANGE, LCM_SL2015, MSVehicle::LaneQ::length, LINKSTATE_ZIPPER, MIN2(), MSLaneChanger::myCandi, MSLaneChanger::myChangeToOpposite, MSVehicle::nextStopDist(), OPPOSITE_OVERTAKING_ONCOMING_LOOKAHEAD, OPPOSITE_OVERTAKING_SAFETYGAP_HEADWAY_FACTOR, MSAbstractLaneChangeModel::setOwnState(), SIMTIME, MSAbstractLaneChangeModel::startLaneChangeManeuver(), STEPS2TIME, STRAIGHT, SVC_EMERGENCY, toString(), MSLaneChanger::veh(), MSVehicle::VEH_SIGNAL_BLINKER_LEFT, and MSVehicle::VEH_SIGNAL_BLINKER_RIGHT.

Referenced by MSLaneChanger::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 > &  neighLead,
const std::pair< MSVehicle *const, double > &  neighFollow,
const std::vector< MSVehicle::LaneQ > &  preb 
) const
protectedinherited

Definition at line 694 of file MSLaneChanger.cpp.

References ACCEL2SPEED, MSCFModel::brakeGap(), 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(), 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_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::changeOpposite(), and MSLaneChanger::checkChangeWithinEdge().

Here is the caller graph for this function:

◆ checkChangeHelper()

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

helper function that calls checkChangeSublane and sets blocker information

Definition at line 234 of file MSLaneChangerSublane.cpp.

References checkChangeSublane(), MSAbstractLaneChangeModel::StateAndDist::dir, MSVehicle::getBestLanes(), MSAbstractLaneChangeModel::StateAndDist::latDist, LCA_BLOCKED, LCA_URGENT, LCA_WANTS_LANECHANGE, MSAbstractLaneChangeModel::StateAndDist::maneuverDist, MSLaneChanger::mayChange(), MSLaneChanger::myCandi, and MSAbstractLaneChangeModel::StateAndDist::state.

Referenced by change().

Here is the caller graph for this function:

◆ 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 578 of file MSLaneChangerSublane.cpp.

References DEBUG_COND, MSVehicle::getBackPositionOnLane(), Named::getID(), MSVehicle::getLane(), MSVehicle::getLaneChangeModel(), MSLane::getRightSideOnEdge(), MSVehicle::influenceChangeDecision(), 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 677 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:

◆ 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 379 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,
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 1351 of file MSLaneChanger.cpp.

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

Referenced by MSLaneChanger::changeOpposite().

Here is the caller graph for this function:

◆ continueChange()

◆ 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 254 of file MSLaneChangerSublane.cpp.

References MSAbstractLaneChangeModel::computeSpeedLat(), DEBUG_COND, Named::getID(), MSVehicle::getLaneChangeModel(), MSAbstractLaneChangeModel::getManeuverDist(), MSLaneChanger::registerUnchanged(), 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 196 of file MSLaneChanger.cpp.

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

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

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 662 of file MSLaneChanger.cpp.

References MSVehicle::getPositionOnLane().

Referenced by MSLaneChanger::getRealFollower().

Here is the caller graph for this function:

◆ getColumnleader()

◆ getLaneAfter()

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

return the next lane in conts beyond lane or nullptr

Definition at line 1592 of file MSLaneChanger.cpp.

Referenced by MSLaneChanger::getColumnleader().

Here is the caller graph for this function:

◆ getLeaders()

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

◆ getRealFollower()

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

Definition at line 592 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

◆ initChanger()

void MSLaneChangerSublane::initChanger ( )
protectedvirtual

Initialize the changer before looping over all vehicles.

Reimplemented from MSLaneChanger.

Definition at line 71 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 121 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 235 of file MSLaneChanger.cpp.

References MSVehicleType::getVehicleClass(), MSBaseVehicle::getVehicleType(), MSLaneChanger::myAllowsChanging, MSLaneChanger::myCandi, and MSLaneChanger::veh().

Referenced by MSLaneChanger::change(), change(), checkChangeHelper(), 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 369 of file MSLaneChanger.cpp.

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

Referenced by abortLCManeuver(), MSLaneChanger::change(), change(), checkChangeToNewLane(), continueChangeSublane(), MSLaneChanger::startChange(), and startChangeSublane().

Here is the caller graph for this function:

◆ startChange()

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

Definition at line 422 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 276 of file MSLaneChangerSublane.cpp.

References abortLCManeuver(), checkChangeToNewLane(), DEBUG_COND, MSAbstractLaneChangeModel::debugVehicle(), DELTA_T, DIST2SPEED, MSVehicle::getActionStepLength(), MSVehicle::getActionStepLengthSecs(), MSVehicle::getAngle(), MSAbstractLaneChangeModel::getCommittedSpeed(), MSVehicle::getFurtherLanes(), Named::getID(), Named::getIDSecure(), MSLane::getIndex(), MSVehicle::getInfluencer(), MSVehicle::getLane(), MSVehicle::getLaneChangeModel(), MSVehicle::getLateralPositionOnLane(), MSVehicle::getLatOffset(), MSVehicleType::getLength(), MSAbstractLaneChangeModel::getManeuverDist(), MSVehicleType::getMaxSpeedLat(), MSAbstractLaneChangeModel::getOwnState(), MSVehicle::getPositionOnLane(), MSAbstractLaneChangeModel::getPreviousManeuverDist(), MSAbstractLaneChangeModel::getPrevState(), MSLane::getRightSideOnEdge(), MSAbstractLaneChangeModel::getShadowLane(), MSLane::getShape(), MSVehicle::getSpeed(), MSBaseVehicle::getVehicleType(), MSBaseVehicle::getWidth(), MSLane::getWidth(), MSGlobals::gLefthand, MSLane::interpolateLanePosToGeometryPos(), Position::INVALID, MSVehicle::isRemoteControlled(), LCA_CHANGE_REASONS, LCA_SUBLANE, LCA_TRACI, PositionVector::length2D(), MSLaneChanger::mayChange(), MSVehicle::myCachedPosition, MSLaneChanger::myChanger, MSVehicle::State::myPosLat, MSVehicle::myState, outputLCEnded(), outputLCStarted(), RAD2DEG, MSLaneChanger::registerUnchanged(), PositionVector::rotationAtOffset(), MSVehicle::setAngle(), MSAbstractLaneChangeModel::setManeuverDist(), MSAbstractLaneChangeModel::setSpeedLat(), MSVehicle::Influencer::setSublaneChange(), SIMTIME, SPEED2DIST, toString(), MSAbstractLaneChangeModel::updateSafeLatDist(), MSAbstractLaneChangeModel::updateShadowLane(), and MSAbstractLaneChangeModel::updateTargetLane().

Referenced by change(), and continueChangeSublane().

Here is the caller graph for this function:

◆ updateChanger()

void MSLaneChangerSublane::updateChanger ( bool  vehHasChanged)
protectedvirtual

◆ 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 178 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 130 of file MSLaneChanger.h.

Referenced by MSLaneChanger::change(), change(), MSLaneChanger::changeOpposite(), 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 117 of file MSLaneChanger.h.

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

Referenced by MSLaneChanger::laneChange().

Here is the caller graph for this function:

Field Documentation

◆ myAllowsChanging

const bool MSLaneChanger::myAllowsChanging
protectedinherited

Definition at line 231 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 234 of file MSLaneChanger.h.

Referenced by MSLaneChanger::changeOpposite().


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