diff --git a/src/microsim/MSLink.cpp b/src/microsim/MSLink.cpp index 6c59fb48ab7a..90927c9f33dc 100644 --- a/src/microsim/MSLink.cpp +++ b/src/microsim/MSLink.cpp @@ -88,6 +88,7 @@ MSLink::MSLink(MSLane* predLane, MSLane* succLane, MSLane* via, LinkDirection di myGreenFraction(1), myLateralShift(0), myWalkingAreaFoe(nullptr), + myHavePedestrianCrossingFoe(false), myParallelRight(nullptr), myParallelLeft(nullptr), myJunction(nullptr) { @@ -155,6 +156,7 @@ MSLink::setRequestInformation(int index, bool hasFoes, bool isCont, } // compute crossing points for (std::vector::const_iterator it_lane = myFoeLanes.begin(); it_lane != myFoeLanes.end(); ++it_lane) { + myHavePedestrianCrossingFoe = myHavePedestrianCrossingFoe || (*it_lane)->getEdge().isCrossing(); const bool sameTarget = myLane == (*it_lane)->getLinkCont()[0]->getLane(); if (sameTarget && !beforeInternalJunction && !contIntersect(lane, *it_lane)) { //if (myLane == (*it_lane)->getLinkCont()[0]->getLane()) { @@ -716,7 +718,7 @@ MSLink::isCont() const { bool MSLink::lastWasContMajor() const { - if (myInternalLane == nullptr || myAmCont) { + if (myInternalLane == nullptr || myAmCont || myHavePedestrianCrossingFoe) { return false; } else { MSLane* pred = myInternalLane->getLogicalPredecessorLane(); diff --git a/src/microsim/MSLink.h b/src/microsim/MSLink.h index 6ad4abfb406b..09bc0ab45520 100644 --- a/src/microsim/MSLink.h +++ b/src/microsim/MSLink.h @@ -616,6 +616,9 @@ class MSLink { std::vector myFoeLanes; const MSLane* myWalkingAreaFoe; + /// @brief whether on of myFoeLanes is a crossing + bool myHavePedestrianCrossingFoe; + /* @brief Links with the same origin lane and the same destination edge that may be in conflict for sublane simulation */ std::vector mySublaneFoeLinks;