77 typedef std::vector<std::pair<MSVehicle*, SUMOReal> >
LinkLeaders;
126 #ifndef HAVE_INTERNAL_LANES
160 const std::vector<MSLink*>& foeLinks,
const std::vector<MSLane*>& foeLanes);
168 const SUMOReal arrivalSpeed,
const SUMOReal leaveSpeed,
const bool setRequest,
191 std::vector<const SUMOVehicle*>* collectFoes = 0)
const;
209 std::vector<const SUMOVehicle*>* collectFoes = 0)
const;
299 #ifdef HAVE_INTERNAL_LANES
304 MSLane* getViaLane()
const;
330 return (leaderSpeed * leaderSpeed / leaderDecel) <= (followerSpeed * followerSpeed / followerDecel);
363 #ifdef HAVE_INTERNAL_LANES
364 MSLane*
const myJunctionInlane;
Representation of a vehicle in the micro simulation.
MSLane * myLane
The lane approached by this link.
void addBlockedLink(MSLink *link)
ApproachingVehicleInformation getApproaching(const SUMOVehicle *veh) const
LinkState myState
The state of the link.
std::vector< std::pair< MSVehicle *, SUMOReal > > LinkLeaders
std::vector< MSLink * > myFoeLinks
bool hasApproachingFoe(SUMOTime arrivalTime, SUMOTime leaveTime, SUMOReal speed, SUMOReal decel=DEFAULT_VEH_DECEL) const
Returns the information whether a vehicle is approaching on one of the link's foe streams...
void setTLState(LinkState state, SUMOTime t)
Sets the current tl-state.
LinkDirection myDirection
An abstract (hopefully human readable) definition of the link's direction.
LinkDirection getDirection() const
Returns the direction the vehicle passing this link take.
std::map< const SUMOVehicle *, ApproachingVehicleInformation > myApproachingVehicles
unsigned int myRequestIdx
The position of the link within this request.
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...
SUMOReal myLength
The length of the link.
LinkDirection
The different directions a link between two lanes may take (or a stream between two edges)...
MSLink & operator=(const MSLink &s)
invalidated assignment operator
Representation of a vehicle.
MSLane * getLane() const
Returns the connected lane.
bool myIsCrossing
Whether any foe links exist.
std::set< MSLink * > myBlockedFoeLinks
LinkState
The right-of-way state of a link between two lanes used when constructing a NBTrafficLightLogic, in MSLink and GNEInternalLane.
void setRequestInformation(unsigned int requestIdx, unsigned int respondIdx, bool isCrossing, bool isCont, const std::vector< MSLink * > &foeLinks, const std::vector< MSLane * > &foeLanes)
Sets the request information.
bool isBlockingAnyone() const
static bool unsafeMergeSpeeds(SUMOReal leaderSpeed, SUMOReal followerSpeed, SUMOReal leaderDecel, SUMOReal followerDecel)
return whether the given vehicles may NOT merge safely
SUMOReal getLength() const
Returns the length of this link.
static bool maybeOccupied(MSLane *lane)
returns whether the given lane may still be occupied by a vehicle currently on it ...
std::vector< MSLane * > myFoeLanes
bool havePriority() const
Returns whether this link is a major link.
bool willHaveBlockedFoe() const
MSLane * getViaLaneOrLane() const
return the via lane if it exists and the lane otherwise
void writeApproaching(OutputDevice &od, const std::string fromLaneID) const
write information about all approaching vehicles to the given output device
bool isCrossing() const
Returns whether this link belongs to a junction where more than one edge is incoming.
unsigned int myRespondIdx
The position within this respond.
MSLink(MSLane *succLane, LinkDirection dir, LinkState state, SUMOReal length)
Constructor for simulation not using internal lanes.
LinkState getState() const
Returns the current state of the link.
Static storage of an output device and its base (abstract) implementation.
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)
Sets the information about an approaching vehicle.
void removeApproaching(const SUMOVehicle *veh)
removes the vehicle from myApproachingVehicles
SUMOTime getLeaveTime(SUMOTime arrivalTime, SUMOReal arrivalSpeed, SUMOReal leaveSpeed, SUMOReal vehicleLength) const
return the expected time at which the given vehicle will clear the link
static SUMOTime myLookaheadTime
Representation of a lane in the micro simulation.
const SUMOReal DEFAULT_VEH_DECEL
unsigned int getRespondIndex() const
Returns the respond index (for visualization)
bool opened(SUMOTime arrivalTime, SUMOReal arrivalSpeed, SUMOReal leaveSpeed, SUMOReal vehicleLength, SUMOReal impatience, SUMOReal decel, SUMOTime waitingTime, std::vector< const SUMOVehicle * > *collectFoes=0) const
Returns the information whether the link may be passed.