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

Method CalculateSubrouteJointsMode

libs/routing/index_router.cpp:708–735  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

706}
707
708RouterResultCode IndexRouter::CalculateSubrouteJointsMode(IndexGraphStarter & starter, RouterDelegate const & delegate,
709 shared_ptr<AStarProgress> const & progress,
710 vector<Segment> & subroute)
711{
712 using JointsStarter = IndexGraphStarterJoints<IndexGraphStarter>;
713 JointsStarter jointStarter(starter, starter.GetStartSegment(), starter.GetFinishSegment());
714
715 using Visitor = JunctionVisitor<JointsStarter>;
716 Visitor visitor(jointStarter, delegate, kVisitPeriod, progress);
717
718 using Vertex = JointsStarter::Vertex;
719 using Edge = JointsStarter::Edge;
720 using Weight = JointsStarter::Weight;
721
722 AStarAlgorithm<Vertex, Edge, Weight>::Params<Visitor, AStarLengthChecker> params(
723 jointStarter, jointStarter.GetStartJoint(), jointStarter.GetFinishJoint(), delegate.GetCancellable(),
724 std::move(visitor), AStarLengthChecker(starter));
725
726 RoutingResult<Vertex, Weight> routingResult;
727 RouterResultCode const result = FindPath<Vertex, Edge, Weight>(params, {} /* mwmIds */, routingResult);
728
729 if (result != RouterResultCode::NoError)
730 return result;
731
732 LOG(LDEBUG, ("Result route weight:", routingResult.m_distance));
733 subroute = ProcessJoints(routingResult.m_path, jointStarter);
734 return result;
735}
736
737RouterResultCode IndexRouter::CalculateSubrouteNoLeapsMode(IndexGraphStarter & starter, RouterDelegate const & delegate,
738 shared_ptr<AStarProgress> const & progress,

Callers

nothing calls this directly

Calls 4

AStarLengthCheckerClass · 0.85
ProcessJointsFunction · 0.85
GetStartSegmentMethod · 0.45
GetFinishSegmentMethod · 0.45

Tested by

no test coverage detected