![]() |
Eclipse SUMO - Simulation of Urban MObility
|
Performs lane changing of vehicles. More...
#include <MSLaneChanger.h>
Data Structures | |
struct | ChangeElem |
Public Types | |
typedef std::vector< ChangeElem > | Changer |
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 | |
Changer & | getChanger () |
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. | |
MSLaneChanger (const std::vector< MSLane * > *lanes, bool allowChanging) | |
Constructor. | |
virtual | ~MSLaneChanger () |
Destructor. | |
Protected Member Functions | |
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 |
virtual 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 | 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) | |
ChangerIt | findCandidate () |
Find current candidate. If there is none, myChanger.end() is returned. | |
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 | 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) |
virtual void | updateChanger (bool vehHasChanged) |
void | updateLanes (SUMOTime t) |
MSVehicle * | veh (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 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::LaneQ > | getBestLanesOpposite (MSVehicle *vehicle, const MSLane *stopLane, double oppositeLength) |
add LaneQ for opposite lanes | |
static MSVehicle * | getCloserFollower (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 MSLane * | getLaneAfter (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 | |
Private Member Functions | |
MSLaneChanger () | |
Default constructor. | |
MSLaneChanger (const MSLaneChanger &) | |
Copy constructor. | |
MSLaneChanger & | operator= (const MSLaneChanger &) |
Assignment operator. | |
Performs lane changing of vehicles.
Definition at line 45 of file MSLaneChanger.h.
typedef std::vector< ChangeElem > MSLaneChanger::Changer |
The list of changers; For each lane, a ChangeElem is being build.
Definition at line 111 of file MSLaneChanger.h.
typedef Changer::iterator MSLaneChanger::ChangerIt |
the iterator moving over the ChangeElems
Definition at line 114 of file MSLaneChanger.h.
typedef Changer::const_iterator MSLaneChanger::ConstChangerIt |
the iterator moving over the ChangeElems
Definition at line 117 of file MSLaneChanger.h.
MSLaneChanger::MSLaneChanger | ( | const std::vector< MSLane * > * | lanes, |
bool | allowChanging | ||
) |
|
virtual |
Destructor.
Definition at line 154 of file MSLaneChanger.cpp.
|
private |
Default constructor.
|
private |
Copy constructor.
|
protected |
Execute TraCI LC-commands.
Definition at line 443 of file MSLaneChanger.cpp.
References continueChange(), MSVehicle::getLaneChangeModel(), MSAbstractLaneChangeModel::getOwnState(), LCA_BLOCKED, LCA_LEFT, LCA_RIGHT, myCandi, and MSAbstractLaneChangeModel::startLaneChangeManeuver().
Referenced by change().
|
protected |
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 1661 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 yieldToDeadlockOncoming().
Referenced by changeOpposite().
|
protectedvirtual |
Find a new candidate and try to change it.
Reimplemented in MSLaneChangerSublane.
Definition at line 293 of file MSLaneChanger.cpp.
References MSVehicle::adaptBestLanesOccupation(), MSAbstractLaneChangeModel::alreadyChanged(), applyTraCICommands(), changeOpposite(), checkChangeWithinEdge(), checkTraCICommands(), MSAbstractLaneChangeModel::clearNeighbors(), continueChange(), DEBUG_COND, findCandidate(), MSVehicle::getBestLanes(), Named::getID(), MSVehicle::getLaneChangeModel(), MSAbstractLaneChangeModel::getOwnState(), getRealLeader(), MSBaseVehicle::getVClass(), hasOppositeStop(), MSVehicle::isActive(), MSAbstractLaneChangeModel::isChangingLanes(), MSAbstractLaneChangeModel::isOpposite(), MSVehicle::isStoppedOnLane(), LCA_BLOCKED, LCA_LEFT, LCA_RIGHT, LCA_URGENT, mayChange(), myAllowsChanging, myCandi, myChanger, registerUnchanged(), MSAbstractLaneChangeModel::setOwnState(), SIMTIME, startChange(), SVC_EMERGENCY, MSVehicle::updateBestLanes(), and veh().
Referenced by laneChange().
|
protected |
try changing to the opposite direction edge.
Definition at line 1219 of file MSLaneChanger.cpp.
References MSLane::allowsChangingLeft(), MSLane::allowsVehicleClass(), avoidDeadlock(), checkChangeOpposite(), checkOppositeStop(), computeOvertakingTime(), computeSafeOppositeLength(), computeSurplusGap(), DEBUG_COND, MSLane::FOLLOW_ONCOMING, foundHilltop(), gDebugFlag5, MSVehicle::getBackPositionOnLane(), MSVehicle::getBestLanes(), MSVehicle::getBestLanesContinuation(), getBestLanesOpposite(), 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(), getMaxOvertakingSpeed(), MSVehicleType::getMinGap(), MSVehicle::getMutableLane(), getOncomingOppositeVehicle(), 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(), MSLane::getVehicleMaxSpeed(), MSBaseVehicle::getVehicleType(), MSLink::getViaLaneOrLane(), MSBaseVehicle::getWaitingSeconds(), MSGlobals::gLefthand, MSNet::hasElevation(), MSVehicle::hasInfluencer(), 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(), myChangeToOpposite, MSVehicle::nextStopDist(), OPPOSITE_OVERTAKING_DEADLOCK_WAIT, OPPOSITE_OVERTAKING_HILLTOP_THRESHOHOLD, OPPOSITE_OVERTAKING_MAX_SPACE_TO_OVERTAKE, OPPOSITE_OVERTAKING_ONCOMING_LOOKAHEAD, resolveDeadlock(), SIMTIME, STEPS2TIME, STRAIGHT, SVC_EMERGENCY, TIME2STEPS, toString(), TS, MSVehicle::VEH_SIGNAL_BLINKER_LEFT, MSVehicle::VEH_SIGNAL_BLINKER_RIGHT, yieldToOppositeWaiting(), and Position::z().
Referenced by change(), and MSLaneChangerSublane::change().
|
protected |
Definition at line 762 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(), myCandi, myChanger, MSLane::nextBlocking(), MSAbstractLaneChangeModel::NO_NEIGHBOR, RIGHT, MSAbstractLaneChangeModel::saveLCState(), MSAbstractLaneChangeModel::saveNeighbors(), MSAbstractLaneChangeModel::setFollowerGaps(), MSAbstractLaneChangeModel::setLeaderGaps(), MSAbstractLaneChangeModel::setOrigLeaderGaps(), SIMTIME, MSLane::succLinkSec(), toString(), TS, MSVehicle::unsafeLinkAhead(), veh(), and MSAbstractLaneChangeModel::wantsChange().
Referenced by checkChangeOpposite(), and checkChangeWithinEdge().
|
protectedvirtual |
Reimplemented in MSLaneChangerSublane.
Definition at line 2186 of file MSLaneChanger.cpp.
References checkChange(), continueChange(), DEBUG_COND, Named::getID(), Named::getIDSecure(), MSVehicle::getLaneChangeModel(), MSVehicle::getMutableLane(), MSAbstractLaneChangeModel::isOpposite(), LCA_BLOCKED, LCA_COOPERATIVE, LCA_WANTS_LANECHANGE, myCandi, MSAbstractLaneChangeModel::setOwnState(), SIMTIME, MSAbstractLaneChangeModel::startLaneChangeManeuver(), and toString().
Referenced by changeOpposite(), and checkOppositeStop().
|
protected |
Definition at line 744 of file MSLaneChanger.cpp.
References checkChange(), getRealFollower(), getRealLeader(), and myCandi.
Referenced by change().
|
protected |
decide whether to change (back or forth) for an opposite stop
Definition at line 1125 of file MSLaneChanger.cpp.
References checkChangeOpposite(), computeSurplusGap(), DEBUG_COND, getBestLanesOpposite(), MSVehicle::getCarFollowModel(), MSVehicle::getLane(), MSVehicle::getLaneChangeModel(), MSCFModel::getMaxAccel(), MSVehicleType::getMaxSpeedLat(), MSBaseVehicle::getNextStop(), MSAbstractLaneChangeModel::getNormalizedLaneIndex(), getOncomingVehicle(), MSLane::getOppositeFollower(), MSLane::getOppositeLeader(), MSVehicle::getSpeed(), MSLane::getSpeedLimit(), MSLane::getVehicleMaxSpeed(), MSBaseVehicle::getVehicleType(), MSGlobals::gLaneChangeDuration, MSGlobals::gLateralResolution, MSAbstractLaneChangeModel::isOpposite(), MSStop::lane, MAX2(), MSVehicle::nextStopDist(), OPPOSITE_OVERTAKING_MAX_LOOKAHEAD, OPPOSITE_OVERTAKING_ONCOMING_LOOKAHEAD, STEPS2TIME, and SUMO_const_laneWidth.
Referenced by changeOpposite().
|
protected |
Take into account traci LC-commands.
Definition at line 422 of file MSLaneChanger.cpp.
References MSAbstractLaneChangeModel::checkTraCICommands(), DEBUG_COND, Named::getID(), MSVehicle::getLaneChangeModel(), MSAbstractLaneChangeModel::getOwnState(), LCA_BLOCKED, LCA_OVERLAPPING, SIMTIME, and toString().
Referenced by change(), and MSLaneChangerSublane::change().
|
staticprotected |
Compute the time and space required for overtaking the given leader.
[in] | vehicle | The vehicle that wants to overtake |
[in] | leader | The vehicle to be overtaken |
[in] | gap | The gap between vehicle and leader |
[out] | timeToOvertake | The time for overtaking |
[out] | spaceToOvertake | The space for overtaking |
XXX ignore speed limit when overtaking through the opposite lane?
Definition at line 2227 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 changeOpposite().
|
protected |
determine for how long the vehicle can drive safely on the opposite side
Definition at line 1902 of file MSLaneChanger.cpp.
References MSCFModel::brakeGap(), DEBUG_COND, MSVehicle::getCarFollowModel(), Named::getID(), MSVehicle::getLaneChangeModel(), MSCFModel::getMaxDecel(), MSLane::getOppositeFollower(), MSLane::getOppositePos(), MSVehicle::getPositionOnLane(), MSAbstractLaneChangeModel::getShadowLane(), MSVehicle::getSpeed(), MSAbstractLaneChangeModel::isOpposite(), MSBaseVehicle::isStopped(), MAX2(), MIN2(), MSVehicle::nextStopDist(), SIMTIME, TIME2STEPS, and yieldToOppositeWaiting().
Referenced by changeOpposite().
|
staticprotected |
Definition at line 2098 of file MSLaneChanger.cpp.
References DEBUG_COND, MSVehicle::getCarFollowModel(), MSCFModel::getHeadwayTime(), Named::getID(), MSVehicle::getLane(), MSVehicle::getLaneChangeModel(), MSAbstractLaneChangeModel::getShadowLane(), MSLane::getVehicleMaxSpeed(), MSBaseVehicle::getWaitingSeconds(), MSAbstractLaneChangeModel::isOpposite(), MSBaseVehicle::isStopped(), OPPOSITE_OVERTAKING_DEADLOCK_WAIT, OPPOSITE_OVERTAKING_SAFETYGAP_HEADWAY_FACTOR, and SIMTIME.
Referenced by changeOpposite(), and checkOppositeStop().
continue a lane change maneuver and return whether the vehicle has completely moved onto the new lane (used if gLaneChangeDuration > 0)
Definition at line 485 of file MSLaneChanger.cpp.
References MSVehicle::computeAngle(), DEBUG_COND, MSAbstractLaneChangeModel::endLaneChangeManeuver(), MSLane::getEdge(), Named::getID(), Named::getIDSecure(), MSLane::getIndex(), MSVehicle::getLane(), MSAbstractLaneChangeModel::getLaneChangeCompletion(), MSAbstractLaneChangeModel::getLaneChangeDirection(), MSVehicle::getLaneChangeModel(), MSVehicle::getLateralPositionOnLane(), MSLane::getParallelLane(), MSAbstractLaneChangeModel::getShadowLane(), MSAbstractLaneChangeModel::getSpeedLat(), MSLane::getWidth(), Position::INVALID, MSAbstractLaneChangeModel::isChangingLanes(), MSAbstractLaneChangeModel::isOpposite(), M_PI, MSVehicle::myAngle, MSVehicle::myCachedPosition, myCandi, myChanger, MSVehicle::State::myPosLat, MSVehicle::myState, MSAbstractLaneChangeModel::primaryLaneChanged(), MSLane::requireCollisionCheck(), SIMTIME, SPEED2DIST, MSAbstractLaneChangeModel::updateCompletion(), and MSAbstractLaneChangeModel::updateShadowLane().
Referenced by applyTraCICommands(), change(), checkChangeOpposite(), and startChange().
|
protected |
Find current candidate. If there is none, myChanger.end() is returned.
Definition at line 235 of file MSLaneChanger.cpp.
References Named::getID(), MSVehicle::getPositionOnLane(), MSVehicle::isFrontOnLane(), myChanger, SIMTIME, and veh().
Referenced by change(), and MSLaneChangerSublane::change().
|
staticprotected |
Definition at line 2132 of file MSLaneChanger.cpp.
References DEBUG_COND, foundHilltop(), Named::getID(), MSLane::getShape(), MSLane::interpolateGeometryPosToLanePos(), and SIMTIME.
Referenced by changeOpposite(), and foundHilltop().
|
staticprotected |
add LaneQ for opposite lanes
Definition at line 1181 of file MSLaneChanger.cpp.
References DEBUG_COND, MSVehicle::getBestLanes(), MSLane::getEdge(), MSAbstractLaneChangeModel::getForwardPos(), Named::getID(), MSLane::getIndex(), MSVehicle::getLane(), MSVehicle::getLaneChangeModel(), MSEdge::getLanes(), MSEdge::getNormalSuccessor(), MSEdge::getNumLanes(), MSEdge::getOppositeEdge(), MSAbstractLaneChangeModel::isOpposite(), MSVehicle::nextStopDist(), and SIMTIME.
Referenced by changeOpposite(), MSLaneChangerSublane::checkChangeHelper(), and checkOppositeStop().
|
inline |
return changer (only to be used by MSLaneChangerSublane from another instance)
Definition at line 120 of file MSLaneChanger.h.
References myChanger.
Referenced by MSLaneChangerSublane::startChangeSublane().
|
staticprotected |
return the closer follower of ego
Definition at line 729 of file MSLaneChanger.cpp.
References MSVehicle::getPositionOnLane().
Referenced by getRealFollower().
|
staticprotected |
return leader vehicle that is to be overtaken
[out] | maxSpace | The maxium space that can be used for the overtaking maneuver (limits speed) |
[in] | vehicle | The vehicle that wants to overtake |
[in] | leader | The vehicle to be overtaken and the gap to this vehicle |
[in] | maxLookAhead | The 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 2350 of file MSLaneChanger.cpp.
References MSCFModel::brakeGap(), DEBUG_COND, MSVehicle::getBackPositionOnLane(), MSVehicle::getBestLanesContinuation(), MSVehicle::getCarFollowModel(), getColumnleader(), MSLane::getEdge(), Named::getID(), Named::getIDSecure(), MSVehicle::getLane(), getLaneAfter(), MSVehicle::getLaneChangeModel(), MSLane::getLastAnyVehicle(), MSLane::getLength(), MSVehicleType::getLengthWithGap(), MSCFModel::getMaxDecel(), MSAbstractLaneChangeModel::getOppositeSafetyFactor(), MSVehicle::getPositionOnLane(), MSCFModel::getSecureGap(), MSVehicle::getSpeed(), MSBaseVehicle::getVClass(), MSLane::getVehicleMaxSpeed(), MSBaseVehicle::getVehicleType(), MAX2(), OPPOSITE_OVERTAKING_MAX_LOOKAHEAD, OPPOSITE_OVERTAKING_MAX_LOOKAHEAD_EMERGENCY, OPPOSITE_OVERTAKING_SAFETY_FACTOR, SVC_EMERGENCY, and toString().
Referenced by changeOpposite(), and getColumnleader().
|
staticprotected |
return the next lane in conts beyond lane or nullptr
Definition at line 2539 of file MSLaneChanger.cpp.
References MSLane::getLinkTo(), and MSLink::havePriority().
Referenced by getColumnleader().
|
staticprotected |
compute maximum maneuver speed
Definition at line 2560 of file MSLaneChanger.cpp.
References MSVehicle::getCarFollowModel(), MSCFModel::getMaxAccel(), and MSCFModel::getMaxDecel().
Referenced by changeOpposite().
|
protected |
Definition at line 2053 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 changeOpposite(), and resolveDeadlock().
|
protected |
Definition at line 2014 of file MSLaneChanger.cpp.
References gDebugFlag5, MSLane::getFollower(), MAX2(), MIN2(), and SIMTIME.
Referenced by changeOpposite(), and checkOppositeStop().
|
protected |
Definition at line 651 of file MSLaneChanger.cpp.
References DEBUG_COND, MSVehicle::getBackPositionOnLane(), getCloserFollower(), Named::getID(), MSVehicleType::getLength(), MSVehicleType::getMinGap(), MSVehicle::getPositionOnLane(), MSBaseVehicle::getVehicleType(), myCandi, SIMTIME, and veh().
Referenced by checkChangeWithinEdge().
|
protected |
Definition at line 542 of file MSLaneChanger.cpp.
References MSCFModel::brakeGap(), DEBUG_COND, MSVehicle::getBackPositionOnLane(), MSVehicle::getBestLanesContinuation(), MSVehicle::getCarFollowModel(), Named::getID(), Named::getIDSecure(), MSLane::getLength(), MSVehicleType::getMinGap(), MSVehicle::getPositionOnLane(), MSVehicle::getSpeed(), MSBaseVehicle::getVehicleType(), myCandi, MSLane::myPartialVehicles, SIMTIME, and veh().
Referenced by change(), and checkChangeWithinEdge().
|
staticprotected |
whether vehicle has an opposite-direction stop within relevant range
Definition at line 1113 of file MSLaneChanger.cpp.
References MSBaseVehicle::getNextStop(), MSBaseVehicle::hasStops(), MSStop::isOpposite, MSVehicle::nextStopDist(), and OPPOSITE_OVERTAKING_MAX_LOOKAHEAD.
Referenced by change(), MSLaneChangerSublane::change(), and changeOpposite().
|
protectedvirtual |
Initialize the changer before looping over all vehicles.
Reimplemented in MSLaneChangerSublane.
Definition at line 182 of file MSLaneChanger.cpp.
References myChanger.
Referenced by MSLaneChangerSublane::initChanger(), and laneChange().
void MSLaneChanger::laneChange | ( | SUMOTime | t | ) |
Start lane-change-process for all vehicles on the edge'e lanes.
Definition at line 159 of file MSLaneChanger.cpp.
References change(), initChanger(), myChanger, updateChanger(), updateLanes(), and vehInChanger().
Referenced by MSEdge::changeLanes().
|
protected |
whether changing to the lane in the given direction should be considered
Definition at line 274 of file MSLaneChanger.cpp.
References MSBaseVehicle::getVClass(), myAllowsChanging, myCandi, and veh().
Referenced by change(), MSLaneChangerSublane::change(), MSLaneChangerSublane::checkChangeHelper(), MSLaneChangerSublane::checkChangeOpposite(), MSLaneChangerSublane::checkChangeToNewLane(), and MSLaneChangerSublane::startChangeSublane().
|
private |
Assignment operator.
|
protected |
Update changer for vehicles that did not change
Definition at line 412 of file MSLaneChanger.cpp.
References MSVehicle::getLaneChangeModel(), MSVehicleType::getLengthWithGap(), MSBaseVehicle::getVehicleType(), myCandi, MSAbstractLaneChangeModel::unchanged(), and veh().
Referenced by change(), MSLaneChangerSublane::change(), and startChange().
|
protected |
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 1830 of file MSLaneChanger.cpp.
References DEBUG_COND, MSVehicle::getBestLanes(), Named::getID(), Named::getIDSecure(), MSLane::getIndex(), MSVehicle::getLane(), MSVehicle::getLaneChangeModel(), MSVehicleType::getLengthWithGap(), MSVehicleType::getMinGap(), getOncomingOppositeVehicle(), MSVehicle::getPositionOnLane(), MSBaseVehicle::getVehicleType(), MSBaseVehicle::getWaitingSeconds(), OPPOSITE_OVERTAKING_DEADLOCK_WAIT, MSAbstractLaneChangeModel::saveBlockerLength(), SIMTIME, UNUSED_PARAMETER, and yieldToDeadlockOncoming().
Referenced by changeOpposite().
Definition at line 465 of file MSLaneChanger.cpp.
References continueChange(), MSVehicle::getLaneChangeModel(), MSVehicle::isRemoteControlled(), myCandi, registerUnchanged(), and MSAbstractLaneChangeModel::startLaneChangeManeuver().
Referenced by change().
|
protectedvirtual |
After the possible change, update the changer.
Reimplemented in MSLaneChangerSublane.
Definition at line 199 of file MSLaneChanger.cpp.
References myCandi, and veh().
Referenced by laneChange(), and MSLaneChangerSublane::updateChanger().
|
protected |
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 217 of file MSLaneChanger.cpp.
References myChanger.
Referenced by laneChange().
|
inlineprotected |
Returns the furthes unhandled vehicle on this change-elements lane or 0 if there is none.
Definition at line 144 of file MSLaneChanger.h.
Referenced by change(), MSLaneChangerSublane::change(), checkChange(), MSLaneChangerSublane::checkChangeSublane(), findCandidate(), MSLaneChangerSublane::getLeaders(), getRealFollower(), getRealLeader(), mayChange(), registerUnchanged(), updateChanger(), and vehInChanger().
|
inlineprotected |
Check if there is a single change-candidate in the changer. Returns true if there is one.
Definition at line 131 of file MSLaneChanger.h.
References myChanger, and veh().
Referenced by laneChange().
|
protected |
check whether to keep stopping for oncoming vehicles in the deadlock zone
Definition at line 1779 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 avoidDeadlock(), and resolveDeadlock().
|
protected |
check whether to yield for oncoming vehicles that have waited longer for opposite overtaking
Definition at line 1807 of file MSLaneChanger.cpp.
References DEBUG_COND, MSVehicle::getFollower(), Named::getID(), MSBaseVehicle::getWaitingSeconds(), MSVehicle::getWaitingTime(), SIMTIME, and STEPS2TIME.
Referenced by changeOpposite(), and computeSafeOppositeLength().
|
protected |
Definition at line 323 of file MSLaneChanger.h.
Referenced by change(), and mayChange().
|
protected |
Change-candidate. Last of the vehicles in changer. Only this one will try to change. Every vehicle on the edge will be a candidate once in the change-process.
Definition at line 319 of file MSLaneChanger.h.
Referenced by MSLaneChangerSublane::abortLCManeuver(), applyTraCICommands(), change(), MSLaneChangerSublane::change(), checkChange(), MSLaneChangerSublane::checkChangeHelper(), checkChangeOpposite(), MSLaneChangerSublane::checkChangeOpposite(), MSLaneChangerSublane::checkChangeSublane(), checkChangeWithinEdge(), continueChange(), getRealFollower(), getRealLeader(), mayChange(), registerUnchanged(), startChange(), updateChanger(), and MSLaneChangerSublane::updateChanger().
|
protected |
Container for ChangeElemements, one for every lane in the edge.
Definition at line 314 of file MSLaneChanger.h.
Referenced by change(), MSLaneChangerSublane::change(), checkChange(), continueChange(), findCandidate(), getChanger(), initChanger(), MSLaneChangerSublane::initChanger(), laneChange(), MSLaneChanger(), MSLaneChangerSublane::MSLaneChangerSublane(), MSLaneChangerSublane::startChangeSublane(), MSLaneChangerSublane::updateChanger(), updateLanes(), and vehInChanger().
|
protected |
whether this edge allows changing to the opposite direction edge
Definition at line 326 of file MSLaneChanger.h.
Referenced by MSLaneChangerSublane::change(), and changeOpposite().