64 #define ZIPPER_ADAPT_TIME 10 66 #define JM_CROSSING_GAP_DEFAULT 10 73 myLaneBefore(predLane),
81 myFoeVisibilityDistance(foeVisibilityDistance),
84 myKeepClear(keepClear),
86 myInternalLaneBefore(0),
101 const std::vector<MSLink*>& foeLinks,
102 const std::vector<MSLane*>& foeLanes,
103 MSLane* internalLaneBefore) {
113 for (std::vector<MSLane*>::const_iterator it_lane = foeLanes.begin(); it_lane != foeLanes.end(); ++it_lane) {
120 if (internalLaneBefore != 0) {
122 lane = internalLaneBefore;
128 #ifdef MSLink_DEBUG_CROSSING_POINTS 132 const bool beforeInternalJunction = lane->
getLinkCont()[0]->getViaLaneOrLane()->getEdge().isInternal();
137 for (std::vector<const MSLane*>::const_iterator it_lane =
myFoeLanes.begin(); it_lane !=
myFoeLanes.end(); ++it_lane) {
139 if (sameTarget && !beforeInternalJunction) {
143 #ifdef MSLink_DEBUG_CROSSING_POINTS 145 <<
" " << lane->
getID()
146 <<
" merges with " << (*it_lane)->getID()
147 <<
" nextLane " << lane->
getLinkCont()[0]->getViaLaneOrLane()->getID()
154 #ifdef MSLink_DEBUG_CROSSING_POINTS 157 bool haveIntersection =
true;
158 if (intersections1.size() == 0) {
159 intersections1.push_back(-10000.0);
160 haveIntersection =
false;
161 }
else if (intersections1.size() > 1) {
162 std::sort(intersections1.begin(), intersections1.end());
164 std::vector<double> intersections2 = (*it_lane)->getShape().intersectsAtLengths2D(lane->
getShape());
165 #ifdef MSLink_DEBUG_CROSSING_POINTS 168 if (intersections2.size() == 0) {
169 intersections2.push_back(0);
170 }
else if (intersections2.size() > 1) {
171 std::sort(intersections2.begin(), intersections2.end());
173 if (haveIntersection) {
175 intersections1.back() -= (*it_lane)->getWidth() / 2;
176 intersections2.back() -= lane->
getWidth() / 2;
179 intersections2.back() = (*it_lane)->interpolateGeometryPosToLanePos(intersections2.back());
184 intersections1.back() = 0;
189 lane->
getLength() - intersections1.back(),
190 (*it_lane)->getLength() - intersections2.back()));
192 #ifdef MSLink_DEBUG_CROSSING_POINTS 194 <<
" intersection of " << lane->
getID()
196 <<
" with " << (*it_lane)->getID()
197 <<
" totalLength=" << (*it_lane)->getLength()
209 for (MSLinkCont::const_iterator it = predLinks.begin(); it != predLinks.end(); ++it) {
210 const MSLane* sibling = (*it)->getViaLane();
211 if (sibling != lane && sibling != 0) {
218 #ifdef MSLink_DEBUG_CROSSING_POINTS 219 std::cout <<
" adding same-origin foe" << sibling->
getID()
232 for (MSLinkCont::const_iterator it = predLinks.begin(); it != predLinks.end(); ++it) {
233 const MSEdge* target = &((*it)->getLane()->getEdge());
234 if (*it !=
this && target == myTarget) {
242 for (MSLinkCont::const_iterator it = predLinks2.begin(); it != predLinks2.end(); ++it) {
243 const MSEdge* target = &((*it)->getLane()->getEdge());
254 std::pair<double, double>
259 const bool setRequest,
const SUMOTime arrivalTimeBraking,
const double arrivalSpeedBraking,
const SUMOTime waitingTime,
double dist) {
261 #ifdef DEBUG_APPROACHING 263 std::cout <<
SIMTIME <<
" Link ''" << (
myLaneBefore == 0 ?
"NULL" : myLaneBefore->
getID()) <<
"'->'" << (
myLane == 0 ?
"NULL" :
myLane->
getID()) <<
"' Adding approaching vehicle '" << approaching->
getID() <<
"'\nCurrently registered vehicles:" << std::endl;
265 std::cout <<
"'" << i->first->getID() <<
"'" << std::endl;
271 arrivalTimeBraking, arrivalSpeedBraking, waitingTime, dist)));
278 #ifdef DEBUG_APPROACHING 280 std::cout <<
SIMTIME <<
" Link ''" << (
myLaneBefore == 0 ?
"NULL" : myLaneBefore->
getID()) <<
"'->'" << (
myLane == 0 ?
"NULL" :
myLane->
getID()) <<
"' Adding approaching vehicle '" << approaching->
getID() <<
"'\nCurrently registered vehicles:" << std::endl;
282 std::cout <<
"'" << i->first->getID() <<
"'" << std::endl;
300 if ((*i)->isBlockingAnyone()) {
311 #ifdef DEBUG_APPROACHING 314 std::cout <<
"' Removing approaching vehicle '" << veh->
getID() <<
"'\nCurrently registered vehicles:" << std::endl;
316 std::cout <<
"'" << i->first->getID() <<
"'" << std::endl;
326 std::map<const SUMOVehicle*, ApproachingVehicleInformation>::const_iterator i =
myApproachingVehicles.find(veh);
337 const double leaveSpeed,
const double vehicleLength)
const {
344 double impatience,
double decel,
SUMOTime waitingTime,
double posLat,
345 std::vector<const SUMOVehicle*>* collectFoes,
bool ignoreRed,
const SUMOVehicle* ego)
const {
356 const MSLink* foeLink = *it;
365 && (arrivalTime > i->second.arrivalTime
369 if (
blockedByFoe(i->first, i->second, arrivalTime, leaveTime, arrivalSpeed, leaveSpeed,
false,
370 impatience, decel, waitingTime, ego)) {
371 #ifdef MSLink_DEBUG_OPENED 373 std::cout <<
SIMTIME <<
" blocked by " << foe->
getID() <<
" arrival=" << arrivalTime <<
" foeArrival=" << i->second.arrivalTime <<
"\n";
376 if (collectFoes == 0) {
377 #ifdef MSLink_DEBUG_OPENED 384 collectFoes->push_back(i->first);
395 return collectFoes == 0 || collectFoes->size() == 0;
401 #ifdef MSLink_DEBUG_OPENED 409 if ((*i)->haveRed()) {
413 if ((*i)->blockedAtTime(arrivalTime, leaveTime, arrivalSpeed, leaveSpeed,
myLane == (*i)->getLane(),
414 impatience, decel, waitingTime, collectFoes, ego)) {
418 if (collectFoes != 0 && collectFoes->size() > 0) {
427 bool sameTargetLane,
double impatience,
double decel,
SUMOTime waitingTime,
428 std::vector<const SUMOVehicle*>* collectFoes,
const SUMOVehicle* ego)
const {
430 #ifdef MSLink_DEBUG_OPENED 436 <<
" foeVeh=" << i->first->getID() <<
" (below ignore speed)" 447 &&
blockedByFoe(i->first, i->second, arrivalTime, leaveTime, arrivalSpeed, leaveSpeed, sameTargetLane,
448 impatience, decel, waitingTime, ego)) {
449 if (collectFoes == 0) {
452 collectFoes->push_back(i->first);
462 SUMOTime arrivalTime,
SUMOTime leaveTime,
double arrivalSpeed,
double leaveSpeed,
463 bool sameTargetLane,
double impatience,
double decel,
SUMOTime waitingTime,
465 #ifdef MSLink_DEBUG_OPENED 468 <<
" foeVeh=" << veh->
getID()
479 assert(waitingTime > 0);
494 #ifdef MSLink_DEBUG_OPENED 496 std::cout <<
" imp=" << impatience <<
" atb=" << avi.
arrivalTimeBraking <<
" at2=" << foeArrivalTime <<
" lA=" << lookAhead <<
" egoLT=" << leaveTime <<
"\n";
501 if (sameTargetLane && (arrivalTime - avi.
leavingTime < lookAhead
504 #ifdef MSLink_DEBUG_OPENED 506 std::cout <<
" blocked (cannot follow)\n";
511 }
else if (foeArrivalTime > leaveTime + lookAhead) {
515 #ifdef MSLink_DEBUG_OPENED 517 std::cout <<
" blocked (cannot lead)\n";
524 #ifdef MSLink_DEBUG_OPENED 526 std::cout <<
" blocked (hard conflict)\n";
543 assert(distLeft > 0);
554 if ((*i)->blockedAtTime(arrivalTime, leaveTime, speed, speed,
myLane == (*i)->getLane(), 0, decel, 0)) {
558 for (std::vector<const MSLane*>::const_iterator i =
myFoeLanes.begin(); i !=
myFoeLanes.end(); ++i) {
559 if ((*i)->getVehicleNumberWithPartials() > 0) {
599 assert(predLink != 0);
614 std::vector<std::pair<SUMOTime, const SUMOVehicle*> > toSort;
616 toSort.push_back(std::make_pair(it->second.arrivalTime, it->first));
618 std::sort(toSort.begin(), toSort.end());
619 for (std::vector<std::pair<SUMOTime, const SUMOVehicle*> >::const_iterator it = toSort.begin(); it != toSort.end(); ++it) {
670 double totalDist = 0.;
671 bool foundCrossing =
false;
678 foundCrossing =
true;
696 for (foe_ix = 0; foe_ix != (int)
myFoeLanes.size(); ++foe_ix) {
703 #ifdef MSLink_DEBUG_CROSSING_POINTS 710 if (dist == -10000.) {
714 #ifdef MSLink_DEBUG_CROSSING_POINTS 716 <<
"' at distance " << dist <<
" (approach along '" 777 for (
int i = 0; i < (int)
myFoeLanes.size(); ++i) {
783 const double crossingWidth = (sameTarget || sameSource) ? 0 : foeLane->
getWidth();
786 std::cout <<
" distToCrossing=" << distToCrossing <<
" foeLane=" << foeLane->
getID() <<
"\n";
788 if (distToCrossing + crossingWidth < 0) {
797 const bool contLane = (foeLane->
getLinkCont()[0]->getViaLaneOrLane()->getEdge().isInternal());
799 const bool cannotIgnore = (contLane || sameTarget || sameSource) && ego != 0;
805 std::cout <<
" candiate leader=" << leader->
getID()
806 <<
" cannotIgnore=" << cannotIgnore
807 <<
" willPass=" << foeLane->
getLinkCont()[0]->getApproaching(leader).willPass
809 <<
" isOpposite=" << isOpposite <<
"\n";
821 bool fromLeft =
true;
826 gap = foeDistToCrossing - leaderBack;
830 distToCrossing += foeLane->
getWidth() / 2;
831 if (gap + foeCrossingWidth < 0) {
838 fromLeft = foeDistToCrossing > 0.5 * foeLane->
getLength();
839 }
else if ((contLane && !sameSource) || isOpposite) {
843 const double leaderBackDist = foeDistToCrossing - leaderBack;
845 std::cout <<
" distToCrossing=" << distToCrossing <<
" leader back=" << leaderBack <<
" backDist=" << leaderBackDist <<
"\n";
847 if (leaderBackDist + foeCrossingWidth < 0) {
855 std::cout <<
" leader=" << leader->
getID() <<
" contLane=" << contLane <<
" cannotIgnore=" << cannotIgnore <<
"\n";
859 const bool stopAsap = leader->
isFrontOnLane(foeLane) ? cannotIgnore : sameTarget;
860 result.push_back(
LinkLeader(leader, gap, stopAsap ? -1 : distToCrossing, fromLeft));
871 const double vehSideOffset = (foeDistToCrossing +
myLaneBefore->
getWidth() * 0.5 - vehWidth * 0.5
887 double distToPeds = std::numeric_limits<double>::max();
889 for (std::set<MSTransportable*>::const_iterator it = persons.begin(); it != persons.end(); ++it) {
892 if (collectBlockers != 0) {
893 collectBlockers->push_back(p);
902 const MSLane* foeLane = *it;
920 <<
" foeLane=" << foeLane->
getID()
921 <<
" leader=" << leader->
getID()
924 <<
" egoLat=" << posLat
925 <<
" leaderLat=" << posLatLeader
928 <<
" foeIndex=" << foeLane->
getIndex()
934 if ((posLat < posLatLeader && myInternalLaneBefore->
getIndex() > foeLane->
getIndex())
937 std::cout <<
SIMTIME <<
" blocked by " << leader->
getID() <<
" (sublane split) foeLane=" << foeLane->
getID() <<
"\n";
939 result.push_back(
LinkLeader(leader, gap, -1));
971 if (direction == -1) {
973 }
else if (direction == 1) {
986 if (before != 0 && after != 0) {
1020 std::vector<const SUMOVehicle*>* collectFoes)
const {
1027 throw ProcessError(
"Zipper junctions with more than two conflicting lanes are not supported (at junction '" 1031 const double secondsToArrival =
STEPS2TIME(arrivalTime - now);
1045 const double vSafeOrig = vSafe;
1046 for (std::vector<const SUMOVehicle*>::const_iterator i = collectFoes->begin(); i != collectFoes->end(); ++i) {
1071 const double followInTime = vSafeOrig + (follow - vSafeOrig) /
MAX2((
double)1, secondsToArrival /
TS);
1072 vSafe =
MIN2(vSafe, followInTime);
1093 followDist > leaderDist &&
const std::vector< IncomingLaneInfo > & getIncomingLanes() const
bool gDebugFlag1
global utility flags for debugging
static double gLateralResolution
OutputDevice & writeAttr(const SumoXMLAttr attr, const T &val)
writes a named attribute
MSLane * getLogicalPredecessorLane() const
get the most likely precedecessor lane (sorted using by_connections_to_sorter). The result is cached ...
int myIndex
The position within this respond.
double getLength() const
Returns the vehicle's length.
MSEdge & getEdge() const
Returns the lane's edge.
Representation of a vehicle in the micro simulation.
bool blockedAtTime(SUMOTime arrivalTime, SUMOTime leaveTime, double arrivalSpeed, double leaveSpeed, bool sameTargetLane, double impatience, double decel, SUMOTime waitingTime, std::vector< const SUMOVehicle *> *collectFoes=0, const SUMOVehicle *ego=0) const
Returns the information whether this link is blocked Valid after the vehicles have set their requests...
double getJMParam(const SumoXMLAttr attr, const double defaultValue) const
Returns the named value from the map, or the default if it is not contained there.
MSLane * myLane
The lane behind the junction approached by this link.
void addBlockedLink(MSLink *link)
LinkState myState
The state of the link.
SUMOTime getWaitingTime() const
Returns the SUMOTime waited (speed was lesser than 0.1m/s)
LinkDirection getDirection() const
Returns the direction the vehicle passing this link take.
MSLane * getLane() const
Returns the connected lane.
double getLengthBeforeCrossing(const MSLane *foeLane) const
Returns the internal length from the beginning of the link's internal lane before to the crossing wit...
MSLane * getLane() const
Returns the lane the vehicle is on.
double distanceTo2D(const Position &p2) const
returns the euclidean distance in the x-y-plane
virtual double followSpeed(const MSVehicle *const veh, double speed, double gap2pred, double predSpeed, double predMaxDecel) const =0
Computes the vehicle's follow speed (no dawdling)
bool myHasFoes
Whether any foe links exist.
This is an uncontrolled, minor link, has to stop.
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
static double rand(std::mt19937 *rng=0)
Returns a random real number in [0, 1)
MSLink * getCorrespondingExitLink() const
returns the corresponding exit link for entryLinks to a junction.
#define ZIPPER_ADAPT_TIME
void setTLState(LinkState state, SUMOTime t)
Sets the current tl-state.
AnyVehicleIterator is a structure, which manages the iteration through all vehicles on the lane...
std::string time2string(SUMOTime t)
LinkDirection myDirection
An abstract (hopefully human readable) definition of the link's direction.
double getZipperSpeed(const MSVehicle *ego, const double dist, double vSafe, SUMOTime arrivalTime, std::vector< const SUMOVehicle *> *collectFoes) const
return the speed at which ego vehicle must approach the zipper link
static const double ZIPPER_ADAPT_DIST
static MSNet * getInstance()
Returns the pointer to the unique instance of MSNet (singleton).
static const SUMOTime myLookaheadTime
double getLength() const
Returns the lane's length.
const PositionVector & getShape() const
Returns this lane's shape.
Position getPosition(const double offset=0) const
Return current position (x/y, cartesian)
std::vector< std::pair< double, double > > myLengthsBehindCrossing
bool hasFoes() const
Returns whether this link belongs to a junction where more than one edge is incoming.
const std::string & getID() const
Returns the id.
double getInternalLengthsBefore() const
Returns the cumulative length of all internal lanes before this link.
double getInternalLengthsAfter() const
Returns the cumulative length of all internal lanes after this link.
This is an uncontrolled, all-way stop link.
std::vector< MSLane * > mySublaneFoeLanes
double getWidth() const
Returns the lane's width.
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.
bool isLeader(const MSVehicle *ego, const MSVehicle *foe) const
bool isInternalJunctionLink() const
return whether the fromLane and the toLane of this link are internal lanes
This is an uncontrolled, zipper-merge link.
MSAbstractLaneChangeModel & getLaneChangeModel()
MSLink * computeParallelLink(int direction)
MSLink * getParallelLink(int direction) const
return the link that is parallel to this lane or 0
bool isFrontOnLane(const MSLane *lane) const
Returns the information whether the front of the vehicle is on the given lane.
bool willHaveBlockedFoe() const
LinkDirection
The different directions a link between two lanes may take (or a stream between two edges)...
bool fromInternalLane() const
return whether the fromLane of this link is an internal lane
const MSLane * myInternalLaneBefore
bool lastWasContMajor() const
whether this is a link past an internal junction which currently has priority
A road/street connecting two junctions.
double getLatOffset(const MSLane *lane) const
Get the offset that that must be added to interpret myState.myPosLat for the given lane...
const MSCFModel & getCarFollowModel() const
Returns the vehicle's car following model definition.
int getIndex() const
Returns the lane's index.
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
const std::map< const SUMOVehicle *, ApproachingVehicleInformation, SUMOVehicle::ComparatorIdLess > & getApproaching() const
return all approaching vehicles
MSLink * getEntryLink() const
Returns the entry link if this is an internal lane, else 0.
const MSCFModel & getCarFollowModel() const
Returns the vehicle type's car following model definition (const version)
MSLane * getViaLane() const
Returns the following inner lane.
virtual bool blockedAtDist(const MSLane *lane, double vehSide, double vehWidth, double oncomingGap, std::vector< const MSPerson *> *collectBlockers)
whether a pedestrian is blocking the crossing of lane for the given vehicle bondaries ...
std::string toString(const T &t, std::streamsize accuracy=gPrecision)
void passedJunction(const MSVehicle *vehicle)
erase vehicle from myLinkLeaders
bool isExitLink() const
return whether the fromLane of this link is an internal lane and toLane is a normal lane ...
Representation of a vehicle.
bool opened(SUMOTime arrivalTime, double arrivalSpeed, double leaveSpeed, double vehicleLength, double impatience, double decel, SUMOTime waitingTime, double posLat=0, std::vector< const SUMOVehicle *> *collectFoes=0, bool ignoreRed=false, const SUMOVehicle *ego=0) const
Returns the information whether the link may be passed.
static bool unsafeMergeSpeeds(double leaderSpeed, double followerSpeed, double leaderDecel, double followerDecel)
return whether the given vehicles may NOT merge safely
static MSPModel * getModel()
double interpolateGeometryPosToLanePos(double geometryPos) const
ApproachingVehicleInformation getApproaching(const SUMOVehicle *veh) const
static const SUMOTime myLookaheadTimeZipper
static bool couldBrakeForLeader(double followDist, double leaderDist, const MSVehicle *follow, const MSVehicle *leader)
whether fllower could stay behind leader (possibly by braking)
const std::set< MSTransportable * > & getPersons() const
Returns this edge's persons set.
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.
std::pair< double, double > getLastIntersections(const MSLane *lane, const MSLane *foe)
LinkState
The right-of-way state of a link between two lanes used when constructing a NBTrafficLightLogic, in MSLink and GNEInternalLane.
SUMOTime getCurrentTimeStep() const
Returns the current simulation step.
AnyVehicleIterator anyVehiclesEnd() const
end iterator for iterating over all vehicles touching this lane in downstream direction ...
const MSLane * getInternalLaneBefore() const
return myInternalLaneBefore (always 0 when compiled without internal lanes)
AnyVehicleIterator anyVehiclesBegin() const
begin iterator for iterating over all vehicles touching this lane in downstream direction ...
double getLengthsBeforeCrossing(const MSLane *foeLane) const
Returns the sum of the lengths along internal lanes following this link to the crossing with the give...
std::vector< LinkLeader > LinkLeaders
std::vector< double > intersectsAtLengths2D(const PositionVector &other) const
For all intersections between this vector and other, return the 2D-length of the subvector from this ...
static bool gUsingInternalLanes
Information whether the simulation regards internal lanes.
double getMinGap() const
Get the free space in front of vehicles of this class.
double getMaxDecel() const
Get the vehicle type's maximal comfortable deceleration [m/s^2].
void initParallelLinks()
initialize parallel links (to be called after all links are loaded)
bool isInternal() const
return whether this edge is an internal edge
const SUMOVTypeParameter & getParameter() const
double getLength() const
Returns the length of this link.
double getLateralPositionOnLane() const
Get the vehicle's lateral position on the lane.
double getWidth() const
Get the width which vehicles of this class shall have when being drawn.
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 maybeOccupied(MSLane *lane)
returns whether the given lane may still be occupied by a vehicle currently on it ...
std::map< const SUMOVehicle *, ApproachingVehicleInformation, SUMOVehicle::ComparatorIdLess > myApproachingVehicles
const MSLane * myWalkingAreaFoe
const MSVehicleType & getVehicleType() const
Returns the vehicle's type definition.
virtual Position getPosition() const
Return the Network coordinate of the transportable.
static MSLink * getConnectingLink(const MSLane &from, const MSLane &to)
Returns the link connecting both lanes Both lanes have to be non-internal; 0 may be returned if no co...
void passedJunction(const MSVehicle *vehicle) const
erase vehicle from myLinkLeaders of this links junction
const MSJunction * getFromJunction() const
MSLane * myLaneBefore
The lane approaching this link.
MSJunction * myJunction
the junction to which this link belongs
MSVehicle * getLastAnyVehicle() const
returns the last vehicle that is fully or partially on this lane
MSLane * getViaLaneOrLane() const
return the via lane if it exists and the lane otherwise
virtual double getLateralPositionOnLane() const =0
Get the vehicle's lateral position on the lane.
#define JM_CROSSING_GAP_DEFAULT
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...
int getIndex() const
Returns the respond index (for visualization)
double getLength() const
Get vehicle's length [m].
static SUMOTime gIgnoreJunctionBlocker
const MSVehicleType & getVehicleType() const
double getBackPositionOnLane(const MSLane *lane) const
Get the vehicle's position relative to the given lane.
The parent class for traffic light logics.
Static storage of an output device and its base (abstract) implementation.
bool closeTag()
Closes the most recently opened tag.
MSLane *const myInternalLane
The following junction-internal lane if used.
static const double SAFETY_GAP
void removeApproaching(const SUMOVehicle *veh)
removes the vehicle from myApproachingVehicles
bool isStopped() const
Returns whether the vehicle is at a stop.
const double INVALID_DOUBLE
const MSLinkCont & getLinkCont() const
returns the container with all links !!!
double getSpeed() const
Returns the vehicle's current speed.
const std::string & getID() const
Returns the name of the vehicle.
Representation of a lane in the micro simulation.
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
bool isLeader(const MSVehicle *ego, const MSVehicle *foe)
virtual const std::string & getID() const =0
Get the vehicle's ID.
SumoXMLEdgeFunc getFunction() const
Returns the edge type (SumoXMLEdgeFunc)
bool haveRed() const
Returns whether this link is blocked by a red (or redyellow) traffic light.
OutputDevice & openTag(const std::string &xmlElement)
Opens an XML tag.
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.
std::vector< const MSLane * > myFoeLanes
MSLane * getParallelLane(int offset) const
Returns the lane with the given offset parallel to this one or 0 if it does not exist.
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...
virtual const MSVehicleType & getVehicleType() const =0
Returns the vehicle's type.