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

Method CalculateSubrouteNoLeapsMode

libs/routing/index_router.cpp:737–762  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

735}
736
737RouterResultCode IndexRouter::CalculateSubrouteNoLeapsMode(IndexGraphStarter & starter, RouterDelegate const & delegate,
738 shared_ptr<AStarProgress> const & progress,
739 vector<Segment> & subroute)
740{
741 using Vertex = IndexGraphStarter::Vertex;
742 using Edge = IndexGraphStarter::Edge;
743 using Weight = IndexGraphStarter::Weight;
744
745 using Visitor = JunctionVisitor<IndexGraphStarter>;
746 Visitor visitor(starter, delegate, kVisitPeriod, progress);
747
748 AStarAlgorithm<Vertex, Edge, Weight>::Params<Visitor, AStarLengthChecker> params(
749 starter, starter.GetStartSegment(), starter.GetFinishSegment(), delegate.GetCancellable(), std::move(visitor),
750 AStarLengthChecker(starter));
751
752 RoutingResult<Vertex, Weight> routingResult;
753 set<NumMwmId> const mwmIds = starter.GetMwms();
754 RouterResultCode const result = FindPath<Vertex, Edge, Weight>(params, mwmIds, routingResult);
755
756 if (result != RouterResultCode::NoError)
757 return result;
758
759 LOG(LDEBUG, ("Result route weight:", routingResult.m_distance));
760 subroute = std::move(routingResult.m_path);
761 return result;
762}
763
764namespace
765{

Callers

nothing calls this directly

Calls 4

AStarLengthCheckerClass · 0.85
GetMwmsMethod · 0.80
GetStartSegmentMethod · 0.45
GetFinishSegmentMethod · 0.45

Tested by

no test coverage detected