Enable ManyToManySearch in MLD
This commit is contained in:
parent
54367bfa98
commit
0fd71260d3
@ -3,5 +3,5 @@ module.exports = {
|
|||||||
verify: '--strict --tags ~@stress --tags ~@todo -f progress --require features/support --require features/step_definitions',
|
verify: '--strict --tags ~@stress --tags ~@todo -f progress --require features/support --require features/step_definitions',
|
||||||
todo: '--strict --tags @todo --require features/support --require features/step_definitions',
|
todo: '--strict --tags @todo --require features/support --require features/step_definitions',
|
||||||
all: '--strict --require features/support --require features/step_definitions',
|
all: '--strict --require features/support --require features/step_definitions',
|
||||||
mld: '--strict --tags ~@stress --tags ~@todo --tags ~@alternative --tags ~@matrix --tags ~@trip --require features/support --require features/step_definitions -f progress'
|
mld: '--strict --tags ~@stress --tags ~@todo --tags ~@alternative --require features/support --require features/step_definitions -f progress'
|
||||||
}
|
}
|
||||||
|
@ -102,6 +102,9 @@ template <> struct HasShortestPathSearch<mld::Algorithm> final : std::true_type
|
|||||||
template <> struct HasMapMatching<mld::Algorithm> final : std::true_type
|
template <> struct HasMapMatching<mld::Algorithm> final : std::true_type
|
||||||
{
|
{
|
||||||
};
|
};
|
||||||
|
template <> struct HasManyToManySearch<mld::Algorithm> final : std::true_type
|
||||||
|
{
|
||||||
|
};
|
||||||
template <> struct HasGetTileTurns<mld::Algorithm> final : std::true_type
|
template <> struct HasGetTileTurns<mld::Algorithm> final : std::true_type
|
||||||
{
|
{
|
||||||
};
|
};
|
||||||
|
@ -42,7 +42,6 @@ class TableAPI final : public BaseAPI
|
|||||||
{
|
{
|
||||||
auto number_of_sources = parameters.sources.size();
|
auto number_of_sources = parameters.sources.size();
|
||||||
auto number_of_destinations = parameters.destinations.size();
|
auto number_of_destinations = parameters.destinations.size();
|
||||||
;
|
|
||||||
|
|
||||||
// symmetric case
|
// symmetric case
|
||||||
if (parameters.sources.empty())
|
if (parameters.sources.empty())
|
||||||
|
@ -157,8 +157,7 @@ RoutingAlgorithms<Algorithm>::ManyToManySearch(const std::vector<PhantomNode> &p
|
|||||||
const std::vector<std::size_t> &source_indices,
|
const std::vector<std::size_t> &source_indices,
|
||||||
const std::vector<std::size_t> &target_indices) const
|
const std::vector<std::size_t> &target_indices) const
|
||||||
{
|
{
|
||||||
return routing_algorithms::ch::manyToManySearch(
|
return manyToManySearch(heaps, facade, phantom_nodes, source_indices, target_indices);
|
||||||
heaps, facade, phantom_nodes, source_indices, target_indices);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
template <typename Algorithm>
|
template <typename Algorithm>
|
||||||
@ -211,16 +210,6 @@ InternalManyRoutesResult inline RoutingAlgorithms<
|
|||||||
{
|
{
|
||||||
throw util::exception("AlternativePathSearch is not implemented");
|
throw util::exception("AlternativePathSearch is not implemented");
|
||||||
}
|
}
|
||||||
|
|
||||||
template <>
|
|
||||||
inline std::vector<EdgeWeight>
|
|
||||||
RoutingAlgorithms<routing_algorithms::mld::Algorithm>::ManyToManySearch(
|
|
||||||
const std::vector<PhantomNode> &,
|
|
||||||
const std::vector<std::size_t> &,
|
|
||||||
const std::vector<std::size_t> &) const
|
|
||||||
{
|
|
||||||
throw util::exception("ManyToManySearch is not implemented");
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -26,6 +26,16 @@ manyToManySearch(SearchEngineData<Algorithm> &engine_working_data,
|
|||||||
const std::vector<std::size_t> &target_indices);
|
const std::vector<std::size_t> &target_indices);
|
||||||
} // namespace ch
|
} // namespace ch
|
||||||
|
|
||||||
|
namespace mld
|
||||||
|
{
|
||||||
|
std::vector<EdgeWeight>
|
||||||
|
manyToManySearch(SearchEngineData<Algorithm> &engine_working_data,
|
||||||
|
const datafacade::ContiguousInternalMemoryDataFacade<Algorithm> &facade,
|
||||||
|
const std::vector<PhantomNode> &phantom_nodes,
|
||||||
|
const std::vector<std::size_t> &source_indices,
|
||||||
|
const std::vector<std::size_t> &target_indices);
|
||||||
|
} // namespace mld
|
||||||
|
|
||||||
} // namespace routing_algorithms
|
} // namespace routing_algorithms
|
||||||
} // namespace engine
|
} // namespace engine
|
||||||
} // namespace osrm
|
} // namespace osrm
|
||||||
|
@ -243,6 +243,31 @@ manyToManySearch(SearchEngineData<Algorithm> &engine_working_data,
|
|||||||
}
|
}
|
||||||
|
|
||||||
} // namespace ch
|
} // namespace ch
|
||||||
|
|
||||||
|
// TODO: generalize with CH version
|
||||||
|
namespace mld
|
||||||
|
{
|
||||||
|
std::vector<EdgeWeight>
|
||||||
|
manyToManySearch(SearchEngineData<Algorithm> &engine_working_data,
|
||||||
|
const datafacade::ContiguousInternalMemoryDataFacade<Algorithm> &facade,
|
||||||
|
const std::vector<PhantomNode> &phantom_nodes,
|
||||||
|
const std::vector<std::size_t> &source_indices,
|
||||||
|
const std::vector<std::size_t> &target_indices)
|
||||||
|
{
|
||||||
|
const auto number_of_sources =
|
||||||
|
source_indices.empty() ? phantom_nodes.size() : source_indices.size();
|
||||||
|
const auto number_of_targets =
|
||||||
|
target_indices.empty() ? phantom_nodes.size() : target_indices.size();
|
||||||
|
const auto number_of_entries = number_of_sources * number_of_targets;
|
||||||
|
|
||||||
|
std::vector<EdgeWeight> weights_table(number_of_entries, INVALID_EDGE_WEIGHT);
|
||||||
|
std::vector<EdgeWeight> durations_table(number_of_entries, MAXIMAL_EDGE_DURATION);
|
||||||
|
|
||||||
|
return durations_table;
|
||||||
|
}
|
||||||
|
|
||||||
|
} // namespace mld
|
||||||
|
|
||||||
} // namespace routing_algorithms
|
} // namespace routing_algorithms
|
||||||
} // namespace engine
|
} // namespace engine
|
||||||
} // namespace osrm
|
} // namespace osrm
|
||||||
|
Loading…
Reference in New Issue
Block a user