From 85100e0669a0eec7ebb692130bf9f09e0085950c Mon Sep 17 00:00:00 2001 From: Viktor Govako Date: Fri, 5 Aug 2022 13:08:43 +0300 Subject: [PATCH] [routing] Use Joints mode (faster than LeapsOnly) for distances < 300km. Signed-off-by: Viktor Govako --- routing/index_router.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/routing/index_router.cpp b/routing/index_router.cpp index 0d1675508d..2a860f1361 100644 --- a/routing/index_router.cpp +++ b/routing/index_router.cpp @@ -71,6 +71,8 @@ double constexpr kAlmostZeroContribution = 1e-7; double constexpr kAdjustRangeM = 5000.0; // Full rebuild if distance(meters) is less. double constexpr kMinDistanceToFinishM = 10000; +// Near MWMs criteria when choosing routing mode. +double constexpr kCloseMwmPointsDistanceM = 300000; double CalcMaxSpeed(NumMwmIds const & numMwmIds, VehicleModelFactoryInterface const & vehicleModelFactory, @@ -1698,7 +1700,8 @@ bool IndexRouter::AreMwmsNear(IndexGraphStarter const & starter) const return true; } - return false; + return ms::DistanceOnEarth(starter.GetStartJunction().GetLatLon(), + starter.GetFinishJunction().GetLatLon()) < kCloseMwmPointsDistanceM; } bool IndexRouter::DoesTransitSectionExist(NumMwmId numMwmId)