Implement distance pruning for MLD as well

This commit is contained in:
Patrick Niklaus
2017-04-10 14:12:10 +00:00
committed by Patrick Niklaus
parent da474a16a9
commit a88fef2937
3 changed files with 31 additions and 16 deletions
@@ -140,8 +140,13 @@ InternalRouteResult directShortestPathSearch(
EdgeWeight weight;
NodeID source_node, target_node;
std::vector<EdgeID> unpacked_edges;
std::tie(weight, source_node, target_node, unpacked_edges) = mld::search(
facade, forward_heap, reverse_heap, DO_NOT_FORCE_LOOPS, DO_NOT_FORCE_LOOPS, phantom_nodes);
std::tie(weight, source_node, target_node, unpacked_edges) = mld::search(facade,
forward_heap,
reverse_heap,
DO_NOT_FORCE_LOOPS,
DO_NOT_FORCE_LOOPS,
INVALID_EDGE_WEIGHT,
phantom_nodes);
return extractRoute(facade, weight, source_node, target_node, unpacked_edges, phantom_nodes);
}
@@ -198,9 +198,9 @@ SubMatchingList mapMatching(SearchEngineData<Algorithm> &engine_working_data,
const auto haversine_distance = util::coordinate_calculation::haversineDistance(
prev_coordinate, current_coordinate);
// assumes minumum of 0.1 m/s
const int duration_upper_bound =
((haversine_distance + max_distance_delta) * 0.25) * 10;
// assumes minumum of 4 m/s
const EdgeWeight weight_upper_bound =
((haversine_distance + max_distance_delta) / 4.) * facade.GetWeightMultiplier();
// compute d_t for this timestamp and the next one
for (const auto s : util::irange<std::size_t>(0UL, prev_viterbi.size()))
@@ -227,7 +227,7 @@ SubMatchingList mapMatching(SearchEngineData<Algorithm> &engine_working_data,
reverse_core_heap,
prev_unbroken_timestamps_list[s].phantom_node,
current_timestamps_list[s_prime].phantom_node,
duration_upper_bound);
weight_upper_bound);
// get distance diff between loc1/2 and locs/s_prime
const auto d_t = std::abs(network_distance - haversine_distance);