From 8037136e9ec18d315f801fc16267970eea599048 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=94=D0=BE=D0=B1=D1=80=D1=8B=D0=B8=CC=86=20=D0=AD=D1=8D?= =?UTF-8?q?=D1=85?= Date: Tue, 17 Jan 2017 16:12:09 +0300 Subject: [PATCH] [routing] fix cross mwm routes --- routing/car_router.cpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/routing/car_router.cpp b/routing/car_router.cpp index e05a2386d8..61d5ee40fd 100644 --- a/routing/car_router.cpp +++ b/routing/car_router.cpp @@ -493,11 +493,12 @@ CarRouter::ResultCode CarRouter::CalculateRoute(m2::PointD const & startPoint, // It is not correct to compare distances from different algorithms. // Add some penalty to cross mwm route to avoid inadequate manoeuvres near the mwm borders. // TODO: remove this hack together with OSRM routing. - double constexpr kCrossMwmPenalty = 0.8; + double constexpr kCrossMwmPenalty = 0.4; if (crossCode == NoError && crossDistanceM < kCrossMwmPenalty * route.GetTotalDistanceMeters()) { - LOG(LINFO, ("Cross mwm path is shorter than single mwm path. Cross distance:", - crossDistanceM, "single distance:", route.GetTotalDistanceMeters())); + LOG(LINFO, ("Cross mwm path is shorter than single mwm path. Cross distance:", crossDistanceM, + "single distance:", route.GetTotalDistanceMeters(), "ratio:", + crossDistanceM / route.GetTotalDistanceMeters())); auto code = MakeRouteFromCrossesPath(finalPath, delegate, route); LOG(LINFO, ("Made final route in", timer.ElapsedNano(), "ns.")); timer.Reset();