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

Function CalculateRoute

libs/routing/routing_tests/index_graph_tools.cpp:472–486  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

470}
471
472AlgorithmForWorldGraph::Result CalculateRoute(IndexGraphStarter & starter, vector<Segment> & roadPoints,
473 double & timeSec)
474{
475 AlgorithmForWorldGraph algorithm;
476 RoutingResult<Segment, RouteWeight> routingResult;
477
478 AlgorithmForWorldGraph::ParamsForTests<AStarLengthChecker> params(
479 starter, starter.GetStartSegment(), starter.GetFinishSegment(), AStarLengthChecker(starter));
480
481 auto const resultCode = algorithm.FindPathBidirectional(params, routingResult);
482
483 timeSec = routingResult.m_distance.GetWeight();
484 roadPoints = routingResult.m_path;
485 return resultCode;
486}
487
488void TestRouteGeometry(IndexGraphStarter & starter, AlgorithmForWorldGraph::Result expectedRouteResult,
489 vector<m2::PointD> const & expectedRouteGeom)

Callers 6

TestRouteFunction · 0.70
UNIT_TESTFunction · 0.70
TestRouteGeometryFunction · 0.70
TestRestrictionsFunction · 0.70
ThreadFuncMethod · 0.50
BuildRouteMethod · 0.50

Calls 5

AStarLengthCheckerClass · 0.85
FindPathBidirectionalMethod · 0.80
GetStartSegmentMethod · 0.45
GetFinishSegmentMethod · 0.45
GetWeightMethod · 0.45

Tested by 5

TestRouteFunction · 0.56
UNIT_TESTFunction · 0.56
TestRouteGeometryFunction · 0.56
TestRestrictionsFunction · 0.56
BuildRouteMethod · 0.40