105 const bool _willPass,
107 const SUMOReal _arrivalSpeedBraking,
111 arrivalTime(_arrivalTime), leavingTime(_leavingTime),
112 arrivalSpeed(_arrivalSpeed), leaveSpeed(_leaveSpeed),
114 arrivalTimeBraking(_arrivalTimeBraking),
115 arrivalSpeedBraking(_arrivalSpeedBraking),
116 waitingTime(_waitingTime),
146 #ifndef HAVE_INTERNAL_LANES 181 const std::vector<MSLink*>& foeLinks,
const std::vector<MSLane*>& foeLanes,
182 MSLane* internalLaneBefore = 0);
190 const SUMOReal arrivalSpeed,
const SUMOReal leaveSpeed,
const bool setRequest,
205 const std::map<const SUMOVehicle*, ApproachingVehicleInformation>&
getApproaching()
const {
219 std::vector<const SUMOVehicle*>* collectFoes = 0)
const;
237 std::vector<const SUMOVehicle*>* collectFoes = 0)
const;
391 #ifdef HAVE_INTERNAL_LANES 396 MSLane* getViaLane()
const;
405 LinkLeaders getLeaderInfo(
SUMOReal dist,
SUMOReal minGap, std::vector<const MSPerson*>* collectBlockers = 0)
const;
411 std::vector<const SUMOVehicle*>* collectFoes)
const;
467 return (leaderSpeed * leaderSpeed / leaderDecel) <= (followerSpeed * followerSpeed / followerDecel);
528 #ifdef HAVE_INTERNAL_LANES 529 MSLane*
const myInternalLane;
534 const MSLane* myInternalLaneBefore;
541 std::vector<std::pair<SUMOReal, SUMOReal> > myLengthsBehindCrossing;
int myIndex
The position within this respond.
Representation of a vehicle in the micro simulation.
MSLane * myLane
The lane behind the junction approached by this link.
bool keepClear() const
whether the junction after this link must be kept clear
void addBlockedLink(MSLink *link)
SUMOTime myMesoTLSPenalty
penalty time for mesoscopic simulation
std::pair< MSVehicle *, SUMOReal > vehAndGap
LinkState myState
The state of the link.
LinkDirection getDirection() const
Returns the direction the vehicle passing this link take.
MSLane * getLane() const
Returns the connected lane.
SUMOTime getMesoTLSPenalty() const
Returns the time penalty for passing a tls-controlled link (meso)
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.
static const SUMOReal ZIPPER_ADAPT_DIST
const int myTLIndex
the traffic light index
bool myHasFoes
Whether any foe links exist.
SUMOTime getLastStateChange() const
The base class for an intersection.
std::vector< MSLink * > mySublaneFoeLinks
const MSLane * getLaneBefore() const
return the internalLaneBefore if it exists and the laneBefore otherwise
SUMOTime myLastStateChange
The time of the last state change.
std::vector< MSLink * > myFoeLinks
void setTLState(LinkState state, SUMOTime t)
Sets the current tl-state.
int getTLIndex() const
Returns the TLS index.
static bool couldBrakeForLeader(SUMOReal followDist, SUMOReal leaderDist, const MSVehicle *follow, const MSVehicle *leader)
whether fllower could stay behind leader (possibly by braking)
LinkDirection myDirection
An abstract (hopefully human readable) definition of the link's direction.
void setMesoTLSPenalty(const SUMOTime penalty)
Sets the time penalty for passing a tls-controlled link (meso)
static const SUMOTime myLookaheadTime
bool hasFoes() const
Returns whether this link belongs to a junction where more than one edge is incoming.
std::map< const SUMOVehicle *, ApproachingVehicleInformation > myApproachingVehicles
SUMOReal getLength() const
Returns the length of this link.
bool isInternalJunctionLink() const
return whether the fromLane and the toLane of this link are internal lanes
MSLink * computeParallelLink(int direction)
MSLink * getParallelLink(int direction) const
return the link that is parallel to this lane or 0
SUMOReal myLength
The length of the link.
LinkState getState() const
Returns the current state of the link.
bool willHaveBlockedFoe() const
LinkDirection
The different directions a link between two lanes may take (or a stream between two edges)...
bool isTLSControlled() const
bool fromInternalLane() const
return whether the fromLane of this link is an internal lane
bool lastWasContMajor() const
whether this is a link past an internal junction which currently has priority
MSLink & operator=(const MSLink &s)
invalidated assignment operator
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
bool isExitLink() const
return whether the fromLane of this link is an internal lane and toLane is a normal lane ...
Representation of a vehicle.
const MSTrafficLightLogic * getTLLogic() const
Returns the TLS index.
LinkLeader(MSVehicle *_veh, SUMOReal _gap, SUMOReal _distToCrossing)
static const SUMOTime myLookaheadTimeZipper
const std::vector< const MSLane * > & getFoeLanes()
void writeApproaching(OutputDevice &od, const std::string fromLaneID) const
write information about all approaching vehicles to the given output device
std::set< MSLink * > myBlockedFoeLinks
bool havePriority() const
Returns whether this link is a major link.
LinkState
The right-of-way state of a link between two lanes used when constructing a NBTrafficLightLogic, in MSLink and GNEInternalLane.
bool isLeader(const MSVehicle *ego, const MSVehicle *foe)
const MSLane * getInternalLaneBefore() const
return myInternalLaneBefore (always 0 when compiled without internal lanes)
std::vector< LinkLeader > LinkLeaders
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.
void initParallelLinks()
initialize parallel links (to be called after all links are loaded)
static bool unsafeMergeSpeeds(SUMOReal leaderSpeed, SUMOReal followerSpeed, SUMOReal leaderDecel, SUMOReal followerDecel)
return whether the given vehicles may NOT merge safely
bool isBlockingAnyone() const
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
static bool maybeOccupied(MSLane *lane)
returns whether the given lane may still be occupied by a vehicle currently on it ...
const MSTrafficLightLogic * myLogic
the controlling logic or 0
SUMOReal getFoeVisibilityDistance() const
Returns the distance on the approaching lane from which an approaching vehicle is able to see all rel...
MSLane * myLaneBefore
The lane approaching this link.
MSLane * getApproachingLane() const
Returns the lane leading to this link.
The link has red light (must brake)
MSJunction * getJunction() const
MSJunction * myJunction
the junction to which this link belongs
MSLane * getViaLaneOrLane() const
return the via lane if it exists and the lane otherwise
int getIndex() const
Returns the respond index (for visualization)
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
The parent class for traffic light logics.
Static storage of an output device and its base (abstract) implementation.
void removeApproaching(const SUMOVehicle *veh)
removes the vehicle from myApproachingVehicles
SUMOReal myFoeVisibilityDistance
distance from which an approaching vehicle is able to see all relevant foes and may accelerate if the...
const std::map< const SUMOVehicle *, ApproachingVehicleInformation > & getApproaching() const
return all approaching vehicles
Representation of a lane in the micro simulation.
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.
The link has red light (must brake) but indicates upcoming green.
void passedJunction(const MSVehicle *vehicle)
erase vehicle from myLinkLeaders of this links junction
bool haveRed() const
Returns whether this link is blocked by a red (or redyellow) traffic light.
SUMOReal getInternalLengthsAfter() const
Returns the cumulative length of all internal lanes after this link.
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.
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...
std::vector< const MSLane * > myFoeLanes
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...