MCPcopy Create free account
hub / github.com/comaps/comaps / ReconstructPath

Method ReconstructPath

libs/routing/base/astar_algorithm.hpp:781–797  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

779// static
780template <typename Vertex, typename Edge, typename Weight>
781void AStarAlgorithm<Vertex, Edge, Weight>::ReconstructPath(Vertex const & v,
782 typename BidirectionalStepContext::Parents const & parent,
783 std::vector<Vertex> & path)
784{
785 path.clear();
786 Vertex cur = v;
787 while (true)
788 {
789 path.push_back(cur);
790 auto const it = parent.find(cur);
791 if (it == parent.end())
792 break;
793 cur = it->second;
794 }
795
796 std::reverse(path.begin(), path.end());
797}
798
799// static
800template <typename Vertex, typename Edge, typename Weight>

Callers 2

FindPathMethod · 0.45
AdjustRouteMethod · 0.45

Calls 5

clearMethod · 0.45
push_backMethod · 0.45
findMethod · 0.45
endMethod · 0.45
beginMethod · 0.45

Tested by

no test coverage detected