diff options
author | Mikhail Gorbushin <m.gorbushin@corp.mail.ru> | 2019-04-10 19:08:41 +0300 |
---|---|---|
committer | Vladimir Byko-Ianko <bykoianko@gmail.com> | 2019-04-18 13:32:08 +0300 |
commit | a07d07dd586d85e4931cf9238d563685a5a9fb94 (patch) | |
tree | dfa1bd19314ec6d7923f69ac1f10bd2feaef2586 /routing/index_router.cpp | |
parent | d721748e03e4556d63d7b384f26b96a6350a4548 (diff) |
[routing] Review fixes
Diffstat (limited to 'routing/index_router.cpp')
-rw-r--r-- | routing/index_router.cpp | 16 |
1 files changed, 7 insertions, 9 deletions
diff --git a/routing/index_router.cpp b/routing/index_router.cpp index d18cca0f2c..b0bbd5d5b4 100644 --- a/routing/index_router.cpp +++ b/routing/index_router.cpp @@ -394,7 +394,7 @@ RouterResultCode IndexRouter::DoCalculateRoute(Checkpoints const & checkpoints, PushPassedSubroutes(checkpoints, subroutes); unique_ptr<IndexGraphStarter> starter; AStarProgress progress; - double const checkpointsLength = checkpoints.GetPathLength(); + double const checkpointsLength = checkpoints.GetSummaryLengthBetweenPointsMeters(); for (size_t i = checkpoints.GetPassedIdx(); i < checkpoints.GetNumSubroutes(); ++i) { @@ -539,7 +539,7 @@ RouterResultCode IndexRouter::CalculateSubroute(Checkpoints const & checkpoints, RoutingResult<JointSegment, RouteWeight> routingResult; uint32_t visitCount = 0; - auto lastValue = progress.GetLastValue(); + auto lastValue = progress.GetLastPercent(); auto const onVisitJunctionJoints = [&](JointSegment const & from, JointSegment const & to) { ++visitCount; @@ -580,7 +580,7 @@ RouterResultCode IndexRouter::CalculateSubroute(Checkpoints const & checkpoints, using Weight = IndexGraphStarter::Weight; uint32_t visitCount = 0; - auto lastValue = progress.GetLastValue(); + auto lastValue = progress.GetLastPercent(); if (mode == WorldGraphMode::LeapsOnly) { AStarSubProgress leapsProgress(checkpoints.GetPoint(subrouteIdx), @@ -908,17 +908,16 @@ RouterResultCode IndexRouter::ProcessLeapsJoints(vector<Segment> const & input, using Edge = IndexGraphStarterJoints<IndexGraphStarter>::Edge; using Weight = IndexGraphStarterJoints<IndexGraphStarter>::Weight; - double contribCoef = static_cast<double>(end - start + 1) / - static_cast<double>(input.size()); - auto startPoint = starter.GetPoint(input[start], true /* front */); - auto endPoint = starter.GetPoint(input[end], true /* front */); + auto const contribCoef = static_cast<double>(end - start + 1) / (input.size()); + auto const startPoint = starter.GetPoint(input[start], true /* front */); + auto const endPoint = starter.GetPoint(input[end], true /* front */); progress.AppendSubProgress({startPoint, endPoint, contribCoef}); SCOPE_GUARD(progressGuard, [&progress]() { progress.EraseLastSubProgress(); }); uint32_t visitCount = 0; - auto lastValue = progress.GetLastValue(); + auto lastValue = progress.GetLastPercent(); auto const onVisitJunctionJoints = [&](JointSegment const & from, JointSegment const & to) { ++visitCount; @@ -967,7 +966,6 @@ RouterResultCode IndexRouter::ProcessLeapsJoints(vector<Segment> const & input, return true; } - LOG(LINFO, ("Can not find path", "from:", MercatorBounds::ToLatLon(starter.GetPoint(input[start], input[start].IsForward())), |