@@ -400,25 +400,25 @@ namespace dsm {
400400 return ;
401401 }
402402 }
403-
403+ Logger::info ( std::format ( " Threshold {} " , m_weightTreshold));
404404 auto const destinationID = pItinerary->destination ();
405- std::vector<double > shortestDistances (this ->graph ().nNodes ());
405+ std::vector<DijkstraResult> shortestPaths (this ->graph ().nNodes ());
406406 tbb::parallel_for_each (
407407 this ->graph ().nodes ().cbegin (),
408408 this ->graph ().nodes ().cend (),
409- [this , &shortestDistances , &destinationID](auto const & it) -> void {
409+ [this , &shortestPaths , &destinationID](auto const & it) -> void {
410410 auto const nodeId{it.first };
411411 if (nodeId == destinationID) {
412- shortestDistances [nodeId] = - 1 . ;
412+ shortestPaths [nodeId] = DijkstraResult{} ;
413413 } else {
414414 auto result =
415415 this ->graph ().shortestPath (nodeId, destinationID, m_weightFunction);
416416 if (result.has_value ()) {
417- shortestDistances [nodeId] = result. value (). distance () ;
417+ shortestPaths [nodeId] = * result;
418418 } else {
419419 Logger::warning (std::format (
420420 " No path found from node {} to node {}" , nodeId, destinationID));
421- shortestDistances [nodeId] = - 1 . ;
421+ shortestPaths [nodeId] = DijkstraResult{} ;
422422 }
423423 }
424424 });
@@ -429,7 +429,7 @@ namespace dsm {
429429 continue ;
430430 }
431431 // save the minimum distance between i and the destination
432- const auto minDistance{shortestDistances [nodeId]};
432+ const auto minDistance{shortestPaths [nodeId]. distance () };
433433 if (minDistance < 0 .) {
434434 continue ;
435435 }
@@ -451,10 +451,13 @@ namespace dsm {
451451 }
452452 continue ;
453453 }
454- auto const distance{shortestDistances [nextNodeId]};
454+ auto const distance{shortestPaths [nextNodeId]. distance () };
455455 if (distance < 0 .) {
456456 continue ;
457457 }
458+ if (shortestPaths[nextNodeId].path ()[1 ] == nodeId && !node->isRoundabout ()) {
459+ continue ;
460+ }
458461 bool const bIsMinDistance{
459462 std::abs (m_weightFunction (&this ->graph (), nodeId, nextNodeId) + distance -
460463 minDistance) <
0 commit comments