 |
Eclipse SUMO - Simulation of Urban MObility
|
Go to the documentation of this file.
99 const double _arrivalSpeed,
const double _leaveSpeed,
100 const bool _willPass,
102 const double _arrivalSpeedBraking,
144 typedef std::map<const SUMOVehicle*, const ApproachingVehicleInformation, ComparatorNumericalIdLess>
ApproachInfos;
170 const std::vector<MSLink*>& foeLinks,
const std::vector<MSLane*>& foeLanes,
171 MSLane* internalLaneBefore = 0);
196 const double arrivalSpeed,
const double leaveSpeed,
const bool setRequest,
197 const SUMOTime arrivalTimeBraking,
const double arrivalSpeedBraking,
198 const SUMOTime waitingTime,
double dist);
225 bool opened(
SUMOTime arrivalTime,
double arrivalSpeed,
double leaveSpeed,
double vehicleLength,
226 double impatience,
double decel,
SUMOTime waitingTime,
229 bool ignoreRed =
false,
247 bool sameTargetLane,
double impatience,
double decel,
SUMOTime waitingTime,
464 SUMOTime getLeaveTime(
const SUMOTime arrivalTime,
const double arrivalSpeed,
const double leaveSpeed,
const double vehicleLength)
const;
538 static inline bool unsafeMergeSpeeds(
double leaderSpeed,
double followerSpeed,
double leaderDecel,
double followerDecel) {
540 return (leaderSpeed * leaderSpeed / leaderDecel) <= (followerSpeed * followerSpeed / followerDecel);
549 SUMOTime arrivalTime,
SUMOTime leaveTime,
double arrivalSpeed,
double leaveSpeed,
550 bool sameTargetLane,
double impatience,
double decel,
SUMOTime waitingTime,
LinkState getOffState() const
Returns the off-state for the link.
bool hasFoes() const
Returns whether this link belongs to a junction where more than one edge is incoming.
double getGreenFraction() const
Returns the average proportion of green time to cycle time.
LinkLeaders getLeaderInfo(const MSVehicle *ego, double dist, std::vector< const MSPerson * > *collectBlockers=0, bool isShadowLink=false) const
Returns all potential link leaders (vehicles on foeLanes) Valid during the planMove() phase.
LinkDirection getDirection() const
Returns the direction the vehicle passing this link take.
double getLateralShift()
return lateral shift that must be applied when passing this link
double myGreenFraction
green fraction at tls for mesoscopic simulation
bool isConflictEntryLink() const
return whether this link enters the conflict area (not a continuation link)
bool havePriority() const
Returns whether this link is a major link.
void setApproaching(const SUMOVehicle *approaching, const SUMOTime arrivalTime, const double arrivalSpeed, const double leaveSpeed, const bool setRequest, const SUMOTime arrivalTimeBraking, const double arrivalSpeedBraking, const SUMOTime waitingTime, double dist)
Sets the information about an approaching vehicle.
LinkLeader(MSVehicle *_veh, double _gap, double _distToCrossing, bool _fromLeft=true)
MSLink * computeParallelLink(int direction)
MSLane * getViaLaneOrLane() const
return the via lane if it exists and the lane otherwise
LinkState getState() const
Returns the current state of the link.
ApproachInfos myApproachingVehicles
bool hasApproachingFoe(SUMOTime arrivalTime, SUMOTime leaveTime, double speed, double decel) const
Returns the information whether a vehicle is approaching on one of the link's foe streams.
Representation of a lane in the micro simulation.
bool myHasFoes
Whether any foe links exist.
SUMOTime getLastStateChange() const
bool lastWasContMajor() const
whether this is a link past an internal junction which currently has priority
The base class for an intersection.
Static storage of an output device and its base (abstract) implementation.
MSLane *const myInternalLane
The following junction-internal lane if used.
LinkState myState
The state of the link.
bool isExitLink() const
return whether the fromLane of this link is an internal lane and toLane is a normal lane
static const double ZIPPER_ADAPT_DIST
static bool unsafeMergeSpeeds(double leaderSpeed, double followerSpeed, double leaderDecel, double followerDecel)
return whether the given vehicles may NOT merge safely
std::vector< const SUMOVehicle * > BlockingFoes
std::map< const SUMOVehicle *, const ApproachingVehicleInformation, ComparatorNumericalIdLess > ApproachInfos
bool blockedByFoe(const SUMOVehicle *veh, const ApproachingVehicleInformation &avi, SUMOTime arrivalTime, SUMOTime leaveTime, double arrivalSpeed, double leaveSpeed, bool sameTargetLane, double impatience, double decel, SUMOTime waitingTime, const SUMOVehicle *ego) const
const std::vector< MSLink * > & getFoeLinks() const
Representation of a vehicle.
MSLane * myLaneBefore
The lane approaching this link.
void addWalkingAreaFoe(const MSLane *lane)
add walkingarea as foe (when entering the junction)
double getLengthsBeforeCrossing(const MSLane *foeLane) const
Returns the sum of the lengths along internal lanes following this link to the crossing with the give...
double myFoeVisibilityDistance
distance from which an approaching vehicle is able to see all relevant foes and may accelerate if the...
LinkDirection
The different directions a link between two lanes may take (or a stream between two edges)....
double getZipperSpeed(const MSVehicle *ego, const double dist, double vSafe, SUMOTime arrivalTime, BlockingFoes *collectFoes) const
return the speed at which ego vehicle must approach the zipper link
MSLink * getParallelLink(int direction) const
return the link that is parallel to this lane or 0
void initParallelLinks()
initialize parallel links (to be called after all links are loaded)
bool isTLSControlled() const
int getIndex() const
Returns the respond index (for visualization)
bool isEntryLink() const
return whether the toLane of this link is an internal lane and fromLane is a normal lane
const MSLane * getWalkingAreaFoeExit()
std::string getDescription() const
get string description for this link
double getInternalLengthsBefore() const
Returns the cumulative length of all internal lanes before this link.
LinkState
The right-of-way state of a link between two lanes used when constructing a NBTrafficLightLogic,...
void checkWalkingAreaFoe(const MSVehicle *ego, const MSLane *foeLane, std::vector< const MSPerson * > *collectBlockers, LinkLeaders &result) const
check for persons on walkingarea in the path of ego vehicle
MSLane * getLane() const
Returns the connected lane.
The link has yellow light, has to brake anyway.
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.
const std::vector< const MSLane * > & getFoeLanes() const
bool myHavePedestrianCrossingFoe
whether on of myFoeLanes is a crossing
void setGreenFraction(const double fraction)
Sets the green fraction for passing a tls-controlled link (meso)
void writeApproaching(OutputDevice &od, const std::string fromLaneID) const
write information about all approaching vehicles to the given output device
const MSLane * myWalkingAreaFoe
walkingArea that must be checked when entering the intersection
The link has red light (must brake) but indicates upcoming green.
const int myTLIndex
the traffic light index
void setTLState(LinkState state, SUMOTime t)
Sets the current tl-state.
MSJunction * getJunction() const
bool opened(SUMOTime arrivalTime, double arrivalSpeed, double leaveSpeed, double vehicleLength, double impatience, double decel, SUMOTime waitingTime, double posLat=0, BlockingFoes *collectFoes=nullptr, bool ignoreRed=false, const SUMOVehicle *ego=nullptr) const
Returns the information whether the link may be passed.
const MSLane * getInternalLaneBefore() const
return myInternalLaneBefore (always 0 when compiled without internal lanes)
std::vector< LinkLeader > LinkLeaders
void addWalkingAreaFoeExit(const MSLane *lane)
add walkingarea as foe (when leaving the junction)
SUMOTime getLeaveTime(const SUMOTime arrivalTime, const double arrivalSpeed, const double leaveSpeed, const double vehicleLength) const
return the expected time at which the given vehicle will clear the link
MSJunction * myJunction
the junction to which this link belongs
std::pair< MSVehicle *, double > vehAndGap
LinkDirection myDirection
An abstract (hopefully human readable) definition of the link's direction.
double myLateralShift
lateral shift to be applied when passing this link
void setMesoTLSPenalty(const SUMOTime penalty)
Sets the time penalty for passing a tls-controlled link (meso)
std::vector< MSLink * > mySublaneFoeLinks2
bool contIntersect(const MSLane *lane, const MSLane *foe)
check if the lane intersects with a foe cont-lane
The parent class for traffic light logics.
void addBlockedLink(MSLink *link)
std::vector< std::pair< double, double > > myLengthsBehindCrossing
static const SUMOTime myLookaheadTimeZipper
bool isBlockingAnyone() const
double getInternalLengthsAfter() const
Returns the cumulative length of all internal lanes after this link.
bool blockedAtTime(SUMOTime arrivalTime, SUMOTime leaveTime, double arrivalSpeed, double leaveSpeed, bool sameTargetLane, double impatience, double decel, SUMOTime waitingTime, BlockingFoes *collectFoes=nullptr, const SUMOVehicle *ego=nullptr) const
Returns the information whether this link is blocked Valid after the vehicles have set their requests...
SUMOTime myMesoTLSPenalty
penalty time at tls for mesoscopic simulation
const LinkState myOffState
The state of the link when switching of traffic light control.
const MSLane * myWalkingAreaFoeExit
walkingArea that must be checked when leaving the intersection
void removeApproaching(const SUMOVehicle *veh)
removes the vehicle from myApproachingVehicles
std::set< MSLink * > myBlockedFoeLinks
SUMOTime getMesoTLSPenalty() const
Returns the time penalty for passing a tls-controlled link (meso)
double getLengthBeforeCrossing(const MSLane *foeLane) const
Returns the internal length from the beginning of the link's internal lane before to the crossing wit...
bool willHaveBlockedFoe() const
bool isInternalJunctionLink() const
return whether the fromLane and the toLane of this link are internal lanes
bool haveRed() const
Returns whether this link is blocked by a red (or redyellow) traffic light.
const MSLane * getWalkingAreaFoe()
get walkingarea as foes
SUMOTime myLastStateChange
The time of the last state change.
std::vector< MSLink * > myFoeLinks
MSLink * getCorrespondingExitLink() const
returns the corresponding exit link for entryLinks to a junction.
const MSLane * myInternalLaneBefore
std::vector< const MSLane * > myFoeLanes
double getLength() const
Returns the length of this link.
std::pair< const SUMOVehicle *, const MSLink * > getFirstApproachingFoe() const
get the foe vehicle that is closest to the intersection or nullptr along with the foe link
The link has yellow light, may pass.
static const SUMOTime myLookaheadTime
MSLink(MSLane *predLane, MSLane *succLane, MSLane *via, LinkDirection dir, LinkState state, double length, double foeVisibilityDistance, bool keepClear, MSTrafficLightLogic *logic, int tlLinkIdx)
Constructor for simulation which uses internal lanes.
static bool couldBrakeForLeader(double followDist, double leaderDist, const MSVehicle *follow, const MSVehicle *leader)
whether follower could stay behind leader (possibly by braking)
bool checkContOff() const
figure out whether the cont status remains in effect when switching off the tls
MSLane * myLane
The lane behind the junction approached by this link.
const MSTrafficLightLogic * myLogic
the controlling logic or 0
double myLength
The length of the link.
std::vector< MSLane * > mySublaneFoeLanes
The link has red light (must brake)
std::vector< MSLink * > mySublaneFoeLinks
bool fromInternalLane() const
return whether the fromLane of this link is an internal lane
const MSLane * getLaneBefore() const
return the internalLaneBefore if it exists and the laneBefore otherwise
int getTLIndex() const
Returns the TLS index.
MSLink & operator=(const MSLink &s)
invalidated assignment operator
const ApproachInfos & getApproaching() const
return all approaching vehicles
bool isExitLinkAfterInternalJunction() const
return whether the fromLane of this link is an internal lane and its incoming lane is also an interna...
MSLane * getViaLane() const
Returns the following inner lane.
double getFoeVisibilityDistance() const
Returns the distance on the approaching lane from which an approaching vehicle is able to see all rel...
int myIndex
The position within this respond.
const MSTrafficLightLogic * getTLLogic() const
Returns the TLS index.
const std::vector< std::pair< double, double > > & getLengthsBehindCrossing() const
Representation of a vehicle in the micro simulation.
bool keepClear() const
whether the junction after this link must be kept clear