![]() |
SUMO - Simulation of Urban MObility
|
#include <MSLink.h>

Data Structures | |
| struct | ApproachingVehicleInformation |
| A structure holding the information about vehicles approaching a link. More... | |
| struct | LinkLeader |
Public Types | |
| typedef std::vector< LinkLeader > | LinkLeaders |
Public Member Functions | |
| void | addBlockedLink (MSLink *link) |
| bool | blockedAtTime (SUMOTime arrivalTime, SUMOTime leaveTime, SUMOReal arrivalSpeed, SUMOReal leaveSpeed, bool sameTargetLane, SUMOReal impatience, SUMOReal decel, SUMOTime waitingTime, std::vector< const SUMOVehicle * > *collectFoes=0) const |
| Returns the information whether this link is blocked Valid after the vehicles have set their requests. More... | |
| bool | fromInternalLane () const |
| return whether the fromLane of this link is an internal lane More... | |
| ApproachingVehicleInformation | getApproaching (const SUMOVehicle *veh) const |
| const std::map< const SUMOVehicle *, ApproachingVehicleInformation > & | getApproaching () const |
| return all approaching vehicles More... | |
| LinkDirection | getDirection () const |
| Returns the direction the vehicle passing this link take. More... | |
| const std::vector< const MSLane * > & | getFoeLanes () |
| SUMOReal | getFoeVisibilityDistance () const |
| Returns the distance on the approaching lane from which an approaching vehicle is able to see all relevant foes and may accelerate if the link is minor and no foe is approaching. More... | |
| SUMOReal | getGreenFraction () const |
| Returns the average proportion of green time to cycle time. More... | |
| int | getIndex () const |
| Returns the respond index (for visualization) More... | |
| const MSLane * | getInternalLaneBefore () const |
| return myInternalLaneBefore (always 0 when compiled without internal lanes) More... | |
| SUMOReal | getInternalLengthsAfter () const |
| Returns the cumulative length of all internal lanes after this link. More... | |
| MSJunction * | getJunction () const |
| MSLane * | getLane () const |
| Returns the connected lane. More... | |
| const MSLane * | getLaneBefore () const |
| return the internalLaneBefore if it exists and the laneBefore otherwise More... | |
| SUMOTime | getLastStateChange () const |
| SUMOTime | getLeaveTime (const SUMOTime arrivalTime, const SUMOReal arrivalSpeed, const SUMOReal leaveSpeed, const SUMOReal vehicleLength) const |
| return the expected time at which the given vehicle will clear the link More... | |
| SUMOReal | getLength () const |
| Returns the length of this link. More... | |
| SUMOTime | getMesoTLSPenalty () const |
| Returns the time penalty for passing a tls-controlled link (meso) More... | |
| MSLink * | getParallelLink (int direction) const |
| return the link that is parallel to this lane or 0 More... | |
| LinkState | getState () const |
| Returns the current state of the link. More... | |
| int | getTLIndex () const |
| Returns the TLS index. More... | |
| const MSTrafficLightLogic * | getTLLogic () const |
| Returns the TLS index. More... | |
| MSLane * | getViaLaneOrLane () const |
| return the via lane if it exists and the lane otherwise More... | |
| SUMOReal | getZipperSpeed (const MSVehicle *ego, const SUMOReal dist, SUMOReal vSafe, SUMOTime arrivalTime, std::vector< const SUMOVehicle * > *collectFoes) const |
| return the speed at which ego vehicle must approach the zipper link More... | |
| bool | hasApproachingFoe (SUMOTime arrivalTime, SUMOTime leaveTime, SUMOReal speed, SUMOReal decel) const |
| Returns the information whether a vehicle is approaching on one of the link's foe streams. More... | |
| bool | hasFoes () const |
| Returns whether this link belongs to a junction where more than one edge is incoming. More... | |
| bool | havePriority () const |
| Returns whether this link is a major link. More... | |
| bool | haveRed () const |
| Returns whether this link is blocked by a red (or redyellow) traffic light. More... | |
| void | initParallelLinks () |
| initialize parallel links (to be called after all links are loaded) More... | |
| bool | isBlockingAnyone () const |
| bool | isCont () const |
| bool | isExitLink () const |
| return whether the fromLane of this link is an internal lane and toLane is a normal lane More... | |
| bool | isInternalJunctionLink () const |
| return whether the fromLane and the toLane of this link are internal lanes More... | |
| bool | isLeader (const MSVehicle *ego, const MSVehicle *foe) |
| bool | isTLSControlled () const |
| bool | keepClear () const |
| whether the junction after this link must be kept clear More... | |
| bool | lastWasContMajor () const |
| whether this is a link past an internal junction which currently has priority More... | |
| MSLink (MSLane *predLane, MSLane *succLane, LinkDirection dir, LinkState state, SUMOReal length, SUMOReal foeVisibilityDistance, bool keepClear, MSTrafficLightLogic *logic, int tlLinkIdx) | |
| Constructor for simulation not using internal lanes. More... | |
| bool | opened (SUMOTime arrivalTime, SUMOReal arrivalSpeed, SUMOReal leaveSpeed, SUMOReal vehicleLength, SUMOReal impatience, SUMOReal decel, SUMOTime waitingTime, SUMOReal posLat=0, std::vector< const SUMOVehicle * > *collectFoes=0) const |
| Returns the information whether the link may be passed. More... | |
| void | passedJunction (const MSVehicle *vehicle) |
| erase vehicle from myLinkLeaders of this links junction More... | |
| void | removeApproaching (const SUMOVehicle *veh) |
| removes the vehicle from myApproachingVehicles More... | |
| void | setApproaching (const SUMOVehicle *approaching, const SUMOTime arrivalTime, const SUMOReal arrivalSpeed, const SUMOReal leaveSpeed, const bool setRequest, const SUMOTime arrivalTimeBraking, const SUMOReal arrivalSpeedBraking, const SUMOTime waitingTime, SUMOReal dist) |
| Sets the information about an approaching vehicle. More... | |
| void | setGreenFraction (const SUMOReal fraction) |
| Sets the green fraction for passing a tls-controlled link (meso) More... | |
| void | setMesoTLSPenalty (const SUMOTime penalty) |
| Sets the time penalty for passing a tls-controlled link (meso) More... | |
| void | setRequestInformation (int index, bool hasFoes, bool isCont, const std::vector< MSLink * > &foeLinks, const std::vector< MSLane * > &foeLanes, MSLane *internalLaneBefore=0) |
| Sets the request information. More... | |
| void | setTLState (LinkState state, SUMOTime t) |
| Sets the current tl-state. More... | |
| bool | willHaveBlockedFoe () const |
| void | writeApproaching (OutputDevice &od, const std::string fromLaneID) const |
| write information about all approaching vehicles to the given output device More... | |
| ~MSLink () | |
| Destructor. More... | |
Static Public Attributes | |
| static const SUMOReal | ZIPPER_ADAPT_DIST |
Private Member Functions | |
| bool | blockedByFoe (const SUMOVehicle *veh, const ApproachingVehicleInformation &avi, SUMOTime arrivalTime, SUMOTime leaveTime, SUMOReal arrivalSpeed, SUMOReal leaveSpeed, bool sameTargetLane, SUMOReal impatience, SUMOReal decel, SUMOTime waitingTime) const |
| MSLink * | computeParallelLink (int direction) |
| MSLink (const MSLink &s) | |
| invalidated copy constructor More... | |
| MSLink & | operator= (const MSLink &s) |
| invalidated assignment operator More... | |
Static Private Member Functions | |
| static bool | couldBrakeForLeader (SUMOReal followDist, SUMOReal leaderDist, const MSVehicle *follow, const MSVehicle *leader) |
| whether fllower could stay behind leader (possibly by braking) More... | |
| static bool | maybeOccupied (MSLane *lane) |
| returns whether the given lane may still be occupied by a vehicle currently on it More... | |
| static bool | unsafeMergeSpeeds (SUMOReal leaderSpeed, SUMOReal followerSpeed, SUMOReal leaderDecel, SUMOReal followerDecel) |
| return whether the given vehicles may NOT merge safely More... | |
Private Attributes | |
| bool | myAmCont |
| std::map< const SUMOVehicle *, ApproachingVehicleInformation > | myApproachingVehicles |
| std::set< MSLink * > | myBlockedFoeLinks |
| LinkDirection | myDirection |
| An abstract (hopefully human readable) definition of the link's direction. More... | |
| std::vector< const MSLane * > | myFoeLanes |
| std::vector< MSLink * > | myFoeLinks |
| SUMOReal | myFoeVisibilityDistance |
| distance from which an approaching vehicle is able to see all relevant foes and may accelerate if the link is minor and no foe is approaching. Defaults to 4.5m. More... | |
| SUMOReal | myGreenFraction |
| bool | myHasFoes |
| Whether any foe links exist. More... | |
| int | myIndex |
| The position within this respond. More... | |
| MSJunction * | myJunction |
| the junction to which this link belongs More... | |
| bool | myKeepClear |
| MSLane * | myLane |
| The lane behind the junction approached by this link. More... | |
| MSLane * | myLaneBefore |
| The lane approaching this link. More... | |
| SUMOTime | myLastStateChange |
| The time of the last state change. More... | |
| SUMOReal | myLength |
| The length of the link. More... | |
| const MSTrafficLightLogic * | myLogic |
| the controlling logic or 0 More... | |
| SUMOTime | myMesoTLSPenalty |
| penalty time for mesoscopic simulation More... | |
| MSLink * | myParallelLeft |
| MSLink * | myParallelRight |
| LinkState | myState |
| The state of the link. More... | |
| std::vector< MSLink * > | mySublaneFoeLinks |
| const int | myTLIndex |
| the traffic light index More... | |
Static Private Attributes | |
| static const SUMOTime | myLookaheadTime = TIME2STEPS(1) |
| static const SUMOTime | myLookaheadTimeZipper = TIME2STEPS(4) |
| typedef std::vector<LinkLeader> MSLink::LinkLeaders |
| MSLink::MSLink | ( | MSLane * | predLane, |
| MSLane * | succLane, | ||
| LinkDirection | dir, | ||
| LinkState | state, | ||
| SUMOReal | length, | ||
| SUMOReal | foeVisibilityDistance, | ||
| bool | keepClear, | ||
| MSTrafficLightLogic * | logic, | ||
| int | tlLinkIdx | ||
| ) |
Constructor for simulation not using internal lanes.
| [in] | succLane | The lane approached by this link |
| [in] | dir | The direction of this link |
| [in] | state | The state of this link |
| [in] | length | The length of this link |
| [in] | keepClear | Whether the junction after this link must be kept clear |
Definition at line 70 of file MSLink.cpp.
References keepClear(), myAmCont, myDirection, myFoeVisibilityDistance, myGreenFraction, myHasFoes, myIndex, myJunction, myKeepClear, myLane, myLaneBefore, myLastStateChange, myLength, myLogic, myMesoTLSPenalty, myParallelLeft, myParallelRight, myState, myTLIndex, SUMOReal, and SUMOTime_MIN.
| MSLink::~MSLink | ( | ) |
Destructor.
Definition at line 116 of file MSLink.cpp.
|
private |
invalidated copy constructor
| void MSLink::addBlockedLink | ( | MSLink * | link | ) |
Definition at line 280 of file MSLink.cpp.
References myBlockedFoeLinks.
| bool MSLink::blockedAtTime | ( | SUMOTime | arrivalTime, |
| SUMOTime | leaveTime, | ||
| SUMOReal | arrivalSpeed, | ||
| SUMOReal | leaveSpeed, | ||
| bool | sameTargetLane, | ||
| SUMOReal | impatience, | ||
| SUMOReal | decel, | ||
| SUMOTime | waitingTime, | ||
| std::vector< const SUMOVehicle * > * | collectFoes = 0 |
||
| ) | const |
Returns the information whether this link is blocked Valid after the vehicles have set their requests.
| [in] | arrivalTime | The arrivalTime of the vehicle who checks for an approaching foe |
| [in] | leaveTime | The leaveTime of the vehicle who checks for an approaching foe |
| [in] | arrivalSpeed | The speed with which the checking vehicle plans to arrive at the link |
| [in] | leaveSpeed | The speed with which the checking vehicle plans to leave the link |
| [in] | sameTargetLane | Whether the link that calls this method has the same target lane as this link |
| [in] | impatience | The impatience of the checking vehicle |
| [in] | decel | The maximum deceleration of the checking vehicle |
| [in] | waitingTime | The waiting time of the checking vehicle |
| [in] | collectFoes | If a vector is passed the return value is always False, instead all blocking foes are collected and inserted into this vector |
Definition at line 390 of file MSLink.cpp.
References blockedByFoe(), and myApproachingVehicles.
Referenced by getApproaching().
|
private |
Definition at line 408 of file MSLink.cpp.
References MSLink::ApproachingVehicleInformation::arrivalSpeedBraking, MSLink::ApproachingVehicleInformation::arrivalTime, MSLink::ApproachingVehicleInformation::arrivalTimeBraking, MSVehicleType::getCarFollowModel(), MSCFModel::getMaxDecel(), SUMOVehicle::getVehicleType(), MSLink::ApproachingVehicleInformation::leaveSpeed, MSLink::ApproachingVehicleInformation::leavingTime, LINKSTATE_ALLWAY_STOP, LINKSTATE_ZIPPER, myLookaheadTime, myLookaheadTimeZipper, myState, unsafeMergeSpeeds(), MSLink::ApproachingVehicleInformation::waitingTime, and MSLink::ApproachingVehicleInformation::willPass.
Referenced by blockedAtTime(), opened(), and unsafeMergeSpeeds().
|
private |
Definition at line 725 of file MSLink.cpp.
References MSLinkContHelper::getConnectingLink(), getLaneBefore(), MSLane::getParallelLane(), and getViaLaneOrLane().
Referenced by initParallelLinks(), and unsafeMergeSpeeds().
|
staticprivate |
whether fllower could stay behind leader (possibly by braking)
Definition at line 837 of file MSLink.cpp.
References MSVehicle::getCarFollowModel(), MSCFModel::getMaxDecel(), and MSVehicle::getSpeed().
Referenced by getZipperSpeed(), and unsafeMergeSpeeds().
| bool MSLink::fromInternalLane | ( | ) | const |
return whether the fromLane of this link is an internal lane
Referenced by getInternalLengthsAfter(), and keepClear().
| MSLink::ApproachingVehicleInformation MSLink::getApproaching | ( | const SUMOVehicle * | veh | ) | const |
Definition at line 304 of file MSLink.cpp.
References myApproachingVehicles.
Referenced by getZipperSpeed().
|
inline |
return all approaching vehicles
Definition at line 205 of file MSLink.h.
References blockedAtTime(), myApproachingVehicles, opened(), and SUMOReal.
| LinkDirection MSLink::getDirection | ( | ) | const |
Returns the direction the vehicle passing this link take.
Definition at line 479 of file MSLink.cpp.
References myDirection.
Referenced by MSLaneChanger::changeOpposite(), MSVehicle::executeMove(), getLastStateChange(), and TraCIServerAPI_Lane::processGet().
|
inline |
Definition at line 459 of file MSLink.h.
References initParallelLinks(), and myFoeLanes.
|
inline |
Returns the distance on the approaching lane from which an approaching vehicle is able to see all relevant foes and may accelerate if the link is minor and no foe is approaching.
Definition at line 352 of file MSLink.h.
References myFoeVisibilityDistance.
|
inline |
Returns the average proportion of green time to cycle time.
Definition at line 445 of file MSLink.h.
References myGreenFraction.
Referenced by MESegment::getTLSCapacity().
|
inline |
Returns the respond index (for visualization)
Definition at line 305 of file MSLink.h.
References myIndex.
Referenced by GUILane::drawLinkNo().
| const MSLane * MSLink::getInternalLaneBefore | ( | ) | const |
return myInternalLaneBefore (always 0 when compiled without internal lanes)
Definition at line 754 of file MSLink.cpp.
References SUMOReal.
Referenced by getInternalLengthsAfter(), and keepClear().
| SUMOReal MSLink::getInternalLengthsAfter | ( | ) | const |
Returns the cumulative length of all internal lanes after this link.
Definition at line 558 of file MSLink.cpp.
References MSLane::anyVehiclesBegin(), MSLane::anyVehiclesEnd(), MSEdge::EDGEFUNCTION_INTERNAL, MSEdge::EDGEFUNCTION_NORMAL, fromInternalLane(), gDebugFlag1, MSVehicle::getBackPositionOnLane(), MSLane::getEdge(), Named::getID(), MSBaseVehicle::getID(), getInternalLaneBefore(), MSVehicle::getLaneChangeModel(), MSLane::getLength(), MSLane::getLinkCont(), MSLane::getLogicalPredecessorLane(), MSVehicleType::getMinGap(), MSPModel::getModel(), MSEdge::getPurpose(), MSBaseVehicle::getVehicleType(), MSVehicle::getWaitingTime(), MSLane::getWidth(), MSGlobals::gIgnoreJunctionBlocker, isExitLink(), MSVehicle::isFrontOnLane(), isInternalJunctionLink(), MSAbstractLaneChangeModel::isOpposite(), myFoeLanes, myLane, MSPModel::SAFETY_GAP, and SUMOReal.
Referenced by MSLCM_LC2013::distanceAlongNextRoundabout(), MSLCM_LC2013::getRoundaboutAheadInfo(), and keepClear().
|
inline |
Definition at line 259 of file MSLink.h.
References myJunction.
| MSLane * MSLink::getLane | ( | ) | const |
Returns the connected lane.
Definition at line 494 of file MSLink.cpp.
References myLane.
Referenced by MSEdge::changeLanes(), MSVehicle::checkRewindLinkLanes(), Command_SaveTLSSwitches::execute(), MSLinkContHelper::getConnectingLink(), getLastStateChange(), MSPModel_Striping::getNextWalkingArea(), MSRailSignal::init(), MESegment::limitedControlOverride(), opened(), TraCIServerAPI_TLS::processGet(), TraCIServerAPI_Lane::processGet(), and writeApproaching().
| const MSLane * MSLink::getLaneBefore | ( | ) | const |
return the internalLaneBefore if it exists and the laneBefore otherwise
Definition at line 698 of file MSLink.cpp.
References myLaneBefore.
Referenced by computeParallelLink(), MSRailSignal::init(), and keepClear().
|
inline |
Definition at line 274 of file MSLink.h.
References getDirection(), getLane(), myLastStateChange, and setTLState().
| SUMOTime MSLink::getLeaveTime | ( | const SUMOTime | arrivalTime, |
| const SUMOReal | arrivalSpeed, | ||
| const SUMOReal | leaveSpeed, | ||
| const SUMOReal | vehicleLength | ||
| ) | const |
return the expected time at which the given vehicle will clear the link
Definition at line 315 of file MSLink.cpp.
References getLength(), MAX2(), NUMERICAL_EPS, SUMOReal, and TIME2STEPS.
Referenced by keepClear(), opened(), and setApproaching().
|
inline |
Returns the length of this link.
Definition at line 341 of file MSLink.h.
References myLength.
Referenced by MEVehicle::estimateLeaveSpeed(), MSVehicle::estimateLeaveSpeed(), getLeaveTime(), and TraCIServerAPI_Lane::processGet().
|
inline |
Returns the time penalty for passing a tls-controlled link (meso)
Definition at line 440 of file MSLink.h.
References myMesoTLSPenalty.
Referenced by MESegment::getLinkPenalty(), MESegment::getMaxPenaltySeconds(), and MSEdge::recalcCache().
| MSLink * MSLink::getParallelLink | ( | int | direction | ) | const |
return the link that is parallel to this lane or 0
Definition at line 712 of file MSLink.cpp.
References myParallelLeft, and myParallelRight.
Referenced by MSVehicle::checkRewindLinkLanes(), MSVehicle::executeMove(), keepClear(), and GUIVehicle::selectBlockingFoes().
|
inline |
Returns the current state of the link.
Definition at line 268 of file MSLink.h.
References myState.
Referenced by MSEdge::allowsLaneChanging(), MSEdge::changeLanes(), MSLaneChanger::changeOpposite(), GUILane::drawLinkRule(), Command_SaveTLCoupledLaneDet::execute(), MSVehicle::executeMove(), MSLane::getIncomingLinkState(), TraCIServerAPI_Lane::processGet(), and MELoop::setApproaching().
|
inline |
|
inline |
| MSLane * MSLink::getViaLaneOrLane | ( | ) | const |
return the via lane if it exists and the lane otherwise
Definition at line 687 of file MSLink.cpp.
References myLane.
Referenced by computeParallelLink(), GUIVehicle::drawAction_drawLinkItems(), MEVehicle::estimateLeaveSpeed(), MSVehicle::estimateLeaveSpeed(), MSVehicle::executeMove(), MSLinkContHelper::getConnectingLink(), MSPModel_Striping::getNextLane(), keepClear(), GUIVehicle::selectBlockingFoes(), and setRequestInformation().
| SUMOReal MSLink::getZipperSpeed | ( | const MSVehicle * | ego, |
| const SUMOReal | dist, | ||
| SUMOReal | vSafe, | ||
| SUMOTime | arrivalTime, | ||
| std::vector< const SUMOVehicle * > * | collectFoes | ||
| ) | const |
return the speed at which ego vehicle must approach the zipper link
Definition at line 764 of file MSLink.cpp.
References MSLink::ApproachingVehicleInformation::arrivalTime, couldBrakeForLeader(), MSLink::ApproachingVehicleInformation::dist, MSCFModel::followSpeed(), getApproaching(), MSVehicle::getCarFollowModel(), MSNet::getCurrentTimeStep(), Named::getID(), MSLane::getIndex(), MSNet::getInstance(), MSVehicle::getLane(), MSVehicleType::getLength(), MSCFModel::getMaxDecel(), MSVehicleType::getMinGap(), MSVehicle::getSpeed(), MSBaseVehicle::getVehicleType(), MAX2(), MIN2(), myFoeLinks, myJunction, STEPS2TIME, SUMOReal, TS, ZIPPER_ADAPT_DIST, and ZIPPER_ADAPT_TIME.
Referenced by keepClear().
| bool MSLink::hasApproachingFoe | ( | SUMOTime | arrivalTime, |
| SUMOTime | leaveTime, | ||
| SUMOReal | speed, | ||
| SUMOReal | decel | ||
| ) | const |
Returns the information whether a vehicle is approaching on one of the link's foe streams.
Valid after the vehicles have set their requests
| [in] | arrivalTime | The arrivalTime of the vehicle who checks for an approaching foe |
| [in] | leaveTime | The leaveTime of the vehicle who checks for an approaching foe |
| [in] | speed | The speed with which the checking vehicle plans to leave the link |
| [in] | decel | The maximum deceleration of the checking vehicle |
Definition at line 463 of file MSLink.cpp.
References myFoeLanes, myFoeLinks, and myLane.
Referenced by isBlockingAnyone(), and TraCIServerAPI_Lane::processGet().
|
inline |
Returns whether this link belongs to a junction where more than one edge is incoming.
Definition at line 361 of file MSLink.h.
References myHasFoes.
Referenced by MSVehicle::checkRewindLinkLanes(), and setRequestInformation().
|
inline |
Returns whether this link is a major link.
Definition at line 322 of file MSLink.h.
References myState.
Referenced by MSLaneChanger::changeOpposite(), MSVehicle::checkRewindLinkLanes(), GUILane::drawGL(), MESegment::getLinkPenalty(), MESegment::getMaxPenaltySeconds(), MESegment::isOpen(), lastWasContMajor(), MSVehicle::nextLinkPriority(), opened(), TraCIServerAPI_Lane::processGet(), and MSEdge::recalcCache().
|
inline |
Returns whether this link is blocked by a red (or redyellow) traffic light.
Definition at line 329 of file MSLink.h.
References LINKSTATE_TL_RED, LINKSTATE_TL_REDYELLOW, and myState.
Referenced by opened().
| void MSLink::initParallelLinks | ( | ) |
initialize parallel links (to be called after all links are loaded)
Definition at line 846 of file MSLink.cpp.
References computeParallelLink(), myParallelLeft, and myParallelRight.
Referenced by getFoeLanes().
|
inline |
Definition at line 240 of file MSLink.h.
References hasApproachingFoe(), myApproachingVehicles, SUMOReal, and willHaveBlockedFoe().
|
inline |
Definition at line 366 of file MSLink.h.
References myAmCont.
Referenced by MSVehicle::checkRewindLinkLanes(), and setRequestInformation().
| bool MSLink::isExitLink | ( | ) | const |
return whether the fromLane of this link is an internal lane and toLane is a normal lane
Referenced by getInternalLengthsAfter(), and keepClear().
| bool MSLink::isInternalJunctionLink | ( | ) | const |
return whether the fromLane and the toLane of this link are internal lanes
Referenced by getInternalLengthsAfter(), and keepClear().
Definition at line 744 of file MSLink.cpp.
References MSJunction::isLeader(), and myJunction.
Referenced by keepClear(), and GUIVehicle::selectBlockingFoes().
|
inline |
Definition at line 333 of file MSLink.h.
References myLogic.
Referenced by MESegment::getLinkPenalty(), and MESegment::getTLSCapacity().
|
inline |
whether the junction after this link must be kept clear
Definition at line 372 of file MSLink.h.
References fromInternalLane(), getInternalLaneBefore(), getInternalLengthsAfter(), getLaneBefore(), getLeaveTime(), getParallelLink(), getViaLaneOrLane(), getZipperSpeed(), isExitLink(), isInternalJunctionLink(), isLeader(), lastWasContMajor(), myKeepClear, passedJunction(), SUMOReal, and writeApproaching().
Referenced by MSVehicle::checkRewindLinkLanes(), and MSLink().
| bool MSLink::lastWasContMajor | ( | ) | const |
whether this is a link past an internal junction which currently has priority
Definition at line 499 of file MSLink.cpp.
References MSEdge::EDGEFUNCTION_INTERNAL, MSLinkContHelper::getConnectingLink(), MSLane::getEdge(), MSLane::getLogicalPredecessorLane(), MSEdge::getPurpose(), havePriority(), and myAmCont.
Referenced by keepClear().
|
staticprivate |
returns whether the given lane may still be occupied by a vehicle currently on it
Definition at line 447 of file MSLink.cpp.
References MSVehicle::getBackPositionOnLane(), MSVehicle::getCarFollowModel(), MSLane::getLastAnyVehicle(), MSLane::getLength(), MSCFModel::getMaxDecel(), MSVehicle::getSpeed(), and SUMOReal.
Referenced by unsafeMergeSpeeds().
| bool MSLink::opened | ( | SUMOTime | arrivalTime, |
| SUMOReal | arrivalSpeed, | ||
| SUMOReal | leaveSpeed, | ||
| SUMOReal | vehicleLength, | ||
| SUMOReal | impatience, | ||
| SUMOReal | decel, | ||
| SUMOTime | waitingTime, | ||
| SUMOReal | posLat = 0, |
||
| std::vector< const SUMOVehicle * > * | collectFoes = 0 |
||
| ) | const |
Returns the information whether the link may be passed.
Valid after the junctions have set their reponds
| [in] | collectFoes | If a vector is passed, all blocking foes are collected and inserted into this vector |
Definition at line 322 of file MSLink.cpp.
References blockedByFoe(), MSLane::getIndex(), getLane(), SUMOVehicle::getLateralPositionOnLane(), getLeaveTime(), MSGlobals::gLateralResolution, MSGlobals::gUseMesoSim, MSGlobals::gUsingInternalLanes, havePriority(), haveRed(), LINKSTATE_ALLWAY_STOP, LINKSTATE_STOP, LINKSTATE_ZIPPER, myAmCont, myApproachingVehicles, myFoeLinks, myLane, myState, and mySublaneFoeLinks.
Referenced by MSVehicle::checkRewindLinkLanes(), MSVehicle::executeMove(), getApproaching(), MESegment::isOpen(), MSPModel_Striping::moveInDirectionOnLane(), TraCIServerAPI_Lane::processGet(), and GUIVehicle::selectBlockingFoes().
| void MSLink::passedJunction | ( | const MSVehicle * | vehicle | ) |
erase vehicle from myLinkLeaders of this links junction
Definition at line 736 of file MSLink.cpp.
References myJunction, and MSJunction::passedJunction().
Referenced by MSVehicle::executeMove(), and keepClear().
| void MSLink::removeApproaching | ( | const SUMOVehicle * | veh | ) |
removes the vehicle from myApproachingVehicles
Definition at line 298 of file MSLink.cpp.
References myApproachingVehicles.
Referenced by MEVehicle::replaceRoute().
| void MSLink::setApproaching | ( | const SUMOVehicle * | approaching, |
| const SUMOTime | arrivalTime, | ||
| const SUMOReal | arrivalSpeed, | ||
| const SUMOReal | leaveSpeed, | ||
| const bool | setRequest, | ||
| const SUMOTime | arrivalTimeBraking, | ||
| const SUMOReal | arrivalSpeedBraking, | ||
| const SUMOTime | waitingTime, | ||
| SUMOReal | dist | ||
| ) |
Sets the information about an approaching vehicle.
The information is stored in myApproachingVehicles.
Definition at line 270 of file MSLink.cpp.
References getLeaveTime(), MSVehicleType::getLength(), SUMOVehicle::getVehicleType(), and myApproachingVehicles.
Referenced by MSVehicle::checkRewindLinkLanes(), and MELoop::setApproaching().
|
inline |
Sets the green fraction for passing a tls-controlled link (meso)
Definition at line 455 of file MSLink.h.
References myGreenFraction.
|
inline |
Sets the time penalty for passing a tls-controlled link (meso)
Definition at line 450 of file MSLink.h.
References myMesoTLSPenalty.
| void MSLink::setRequestInformation | ( | int | index, |
| bool | hasFoes, | ||
| bool | isCont, | ||
| const std::vector< MSLink * > & | foeLinks, | ||
| const std::vector< MSLane * > & | foeLanes, | ||
| MSLane * | internalLaneBefore = 0 |
||
| ) |
Sets the request information.
Because traffic lights and junction logics are loaded after links, we have to assign the information about the right-of-way requests and responses after the initialisation.
Definition at line 120 of file MSLink.cpp.
References MSLane::getEdge(), MSEdge::getFromJunction(), Named::getID(), MSLane::getIncomingLanes(), getLastIntersections(), MSLane::getLength(), MSLane::getLinkCont(), MSLane::getLogicalPredecessorLane(), MSLane::getShape(), getViaLaneOrLane(), MSLane::getWidth(), MSGlobals::gLateralResolution, hasFoes(), MSLane::interpolateGeometryPosToLanePos(), PositionVector::intersectsAtLengths2D(), isCont(), MSEdge::isInternal(), myAmCont, myFoeLanes, myFoeLinks, myHasFoes, myIndex, myJunction, myLane, myLaneBefore, mySublaneFoeLinks, NUMERICAL_EPS, toString(), and UNUSED_PARAMETER.
Referenced by MSRightOfWayJunction::postloadInit().
Sets the current tl-state.
| [in] | state | The current state of the link |
| [in] | t | The time of the state change |
Definition at line 485 of file MSLink.cpp.
References myLastStateChange, and myState.
Referenced by MSTrafficLightLogic::addLink(), and getLastStateChange().
|
inlinestaticprivate |
return whether the given vehicles may NOT merge safely
Definition at line 468 of file MSLink.h.
References blockedByFoe(), computeParallelLink(), couldBrakeForLeader(), maybeOccupied(), and SUMOReal.
Referenced by blockedByFoe().
| bool MSLink::willHaveBlockedFoe | ( | ) | const |
Definition at line 287 of file MSLink.cpp.
References myBlockedFoeLinks.
Referenced by isBlockingAnyone().
| void MSLink::writeApproaching | ( | OutputDevice & | od, |
| const std::string | fromLaneID | ||
| ) | const |
write information about all approaching vehicles to the given output device
Definition at line 522 of file MSLink.cpp.
References MSLink::ApproachingVehicleInformation::arrivalSpeed, MSLink::ApproachingVehicleInformation::arrivalSpeedBraking, MSLink::ApproachingVehicleInformation::arrivalTime, MSLink::ApproachingVehicleInformation::arrivalTimeBraking, OutputDevice::closeTag(), Named::getID(), getLane(), MSLink::ApproachingVehicleInformation::leaveSpeed, MSLink::ApproachingVehicleInformation::leavingTime, myApproachingVehicles, OutputDevice::openTag(), SUMO_ATTR_FROM, SUMO_ATTR_ID, SUMO_ATTR_IMPATIENCE, SUMO_ATTR_TO, SUMO_ATTR_VIA, SUMOReal, time2string(), toString(), MSLink::ApproachingVehicleInformation::willPass, and OutputDevice::writeAttr().
Referenced by keepClear().
|
private |
Definition at line 524 of file MSLink.h.
Referenced by isCont(), lastWasContMajor(), MSLink(), opened(), and setRequestInformation().
|
private |
Definition at line 491 of file MSLink.h.
Referenced by blockedAtTime(), getApproaching(), isBlockingAnyone(), opened(), removeApproaching(), setApproaching(), and writeApproaching().
|
private |
Definition at line 492 of file MSLink.h.
Referenced by addBlockedLink(), and willHaveBlockedFoe().
|
private |
An abstract (hopefully human readable) definition of the link's direction.
Definition at line 510 of file MSLink.h.
Referenced by getDirection(), and MSLink().
|
private |
Definition at line 551 of file MSLink.h.
Referenced by getFoeLanes(), getInternalLengthsAfter(), hasApproachingFoe(), and setRequestInformation().
|
private |
Definition at line 550 of file MSLink.h.
Referenced by getZipperSpeed(), hasApproachingFoe(), opened(), and setRequestInformation().
|
private |
distance from which an approaching vehicle is able to see all relevant foes and may accelerate if the link is minor and no foe is approaching. Defaults to 4.5m.
Definition at line 518 of file MSLink.h.
Referenced by getFoeVisibilityDistance(), and MSLink().
|
private |
Definition at line 530 of file MSLink.h.
Referenced by getGreenFraction(), MSLink(), and setGreenFraction().
|
private |
Whether any foe links exist.
Definition at line 521 of file MSLink.h.
Referenced by hasFoes(), MSLink(), and setRequestInformation().
|
private |
The position within this respond.
Definition at line 495 of file MSLink.h.
Referenced by getIndex(), MSLink(), and setRequestInformation().
|
private |
the junction to which this link belongs
Definition at line 564 of file MSLink.h.
Referenced by getJunction(), getZipperSpeed(), isLeader(), MSLink(), passedJunction(), and setRequestInformation().
|
private |
Definition at line 526 of file MSLink.h.
Referenced by keepClear(), and MSLink().
|
private |
The lane behind the junction approached by this link.
Definition at line 486 of file MSLink.h.
Referenced by getInternalLengthsAfter(), getLane(), getViaLaneOrLane(), hasApproachingFoe(), MSLink(), opened(), and setRequestInformation().
|
private |
The lane approaching this link.
Definition at line 489 of file MSLink.h.
Referenced by getLaneBefore(), MSLink(), and setRequestInformation().
|
private |
The time of the last state change.
Definition at line 507 of file MSLink.h.
Referenced by getLastStateChange(), MSLink(), and setTLState().
|
private |
The length of the link.
Definition at line 513 of file MSLink.h.
Referenced by getLength(), and MSLink().
|
private |
the controlling logic or 0
Definition at line 501 of file MSLink.h.
Referenced by getTLLogic(), isTLSControlled(), and MSLink().
|
staticprivate |
Definition at line 557 of file MSLink.h.
Referenced by blockedByFoe().
|
staticprivate |
Definition at line 558 of file MSLink.h.
Referenced by blockedByFoe().
|
private |
penalty time for mesoscopic simulation
Definition at line 529 of file MSLink.h.
Referenced by getMesoTLSPenalty(), MSLink(), and setMesoTLSPenalty().
|
private |
Definition at line 561 of file MSLink.h.
Referenced by getParallelLink(), initParallelLinks(), and MSLink().
|
private |
Definition at line 560 of file MSLink.h.
Referenced by getParallelLink(), initParallelLinks(), and MSLink().
|
private |
The state of the link.
Definition at line 504 of file MSLink.h.
Referenced by blockedByFoe(), getState(), havePriority(), haveRed(), MSLink(), opened(), and setTLState().
|
private |
Definition at line 555 of file MSLink.h.
Referenced by opened(), and setRequestInformation().
|
private |
the traffic light index
Definition at line 498 of file MSLink.h.
Referenced by getTLIndex(), and MSLink().
|
static |
Definition at line 81 of file MSLink.h.
Referenced by getZipperSpeed(), and MSVehicle::unsafeLinkAhead().