Skip to content

Commit

Permalink
skipping last stop in cul-de-sac rerouting ref #15552
Browse files Browse the repository at this point in the history
Signed-off-by: m-kro <[email protected]>
  • Loading branch information
m-kro committed Oct 2, 2024
1 parent 88e9192 commit 2b5d3e5
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions src/microsim/MSBaseVehicle.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -288,7 +288,8 @@ MSBaseVehicle::reroute(SUMOTime t, const std::string& info, SUMOAbstractRouter<M
sourcePos = getNextStop().pars.endPos;
}
// avoid superfluous waypoints for first and last edge
const bool skipFirst = stops.front() == source && (source != getEdge() || sourcePos + getBrakeGap() <= firstPos + NUMERICAL_EPS);
const bool skipFirst = stops.front() == source &&
(source != getEdge() || (source == sink && sink->getNumSuccessors() == 0 && jumps.size() == 0) || sourcePos + getBrakeGap() <= firstPos + NUMERICAL_EPS);
const bool skipLast = (stops.back() == sink
&& myArrivalPos >= lastPos
&& (stops.size() < 2 || stops.back() != stops[stops.size() - 2])
Expand Down Expand Up @@ -346,10 +347,6 @@ MSBaseVehicle::reroute(SUMOTime t, const std::string& info, SUMOAbstractRouter<M
source = stopEdge;
continue;
}
//if (source == stopEdge) {
// edges.push_back(source);
// continue;
//}
router.computeLooped(source, stopEdge, this, t, into, silent);
//std::cout << SIMTIME << " reroute veh=" << getID() << " source=" << source->getID() << " target=" << (*s)->getID() << " edges=" << toString(into) << "\n";
if (into.size() > 0) {
Expand Down

0 comments on commit 2b5d3e5

Please sign in to comment.