2017-01-09 15:40:33 -05:00
|
|
|
#ifndef OSRM_ENGINE_ALGORITHM_HPP
|
|
|
|
#define OSRM_ENGINE_ALGORITHM_HPP
|
|
|
|
|
2017-02-24 21:22:17 -05:00
|
|
|
#include <type_traits>
|
|
|
|
|
2017-01-09 15:40:33 -05:00
|
|
|
namespace osrm
|
|
|
|
{
|
|
|
|
namespace engine
|
|
|
|
{
|
2017-03-31 06:52:04 -04:00
|
|
|
namespace routing_algorithms
|
2017-01-09 15:40:33 -05:00
|
|
|
{
|
|
|
|
|
|
|
|
// Contraction Hiearchy
|
2017-03-31 06:52:04 -04:00
|
|
|
namespace ch
|
|
|
|
{
|
|
|
|
struct Algorithm final
|
2017-02-25 00:13:38 -05:00
|
|
|
{
|
|
|
|
};
|
2017-03-31 06:52:04 -04:00
|
|
|
}
|
2017-02-24 21:22:17 -05:00
|
|
|
// Contraction Hiearchy with core
|
2017-03-31 06:52:04 -04:00
|
|
|
namespace corech
|
|
|
|
{
|
|
|
|
struct Algorithm final
|
2017-02-25 00:13:38 -05:00
|
|
|
{
|
|
|
|
};
|
2017-03-31 06:52:04 -04:00
|
|
|
}
|
2017-03-01 15:29:04 -05:00
|
|
|
// Multi-Level Dijkstra
|
2017-03-31 06:52:04 -04:00
|
|
|
namespace mld
|
|
|
|
{
|
|
|
|
struct Algorithm final
|
2017-03-01 15:29:04 -05:00
|
|
|
{
|
|
|
|
};
|
2017-01-09 15:40:33 -05:00
|
|
|
}
|
|
|
|
|
2017-03-31 06:52:04 -04:00
|
|
|
// Algorithm names
|
|
|
|
template <typename AlgorithmT> const char *name();
|
|
|
|
template <> inline const char *name<ch::Algorithm>() { return "CH"; }
|
|
|
|
template <> inline const char *name<corech::Algorithm>() { return "CoreCH"; }
|
|
|
|
template <> inline const char *name<mld::Algorithm>() { return "MLD"; }
|
2017-01-09 15:40:33 -05:00
|
|
|
|
2017-02-25 00:13:38 -05:00
|
|
|
template <typename AlgorithmT> struct HasAlternativePathSearch final : std::false_type
|
|
|
|
{
|
|
|
|
};
|
|
|
|
template <typename AlgorithmT> struct HasShortestPathSearch final : std::false_type
|
|
|
|
{
|
|
|
|
};
|
|
|
|
template <typename AlgorithmT> struct HasDirectShortestPathSearch final : std::false_type
|
|
|
|
{
|
|
|
|
};
|
|
|
|
template <typename AlgorithmT> struct HasMapMatching final : std::false_type
|
|
|
|
{
|
|
|
|
};
|
|
|
|
template <typename AlgorithmT> struct HasManyToManySearch final : std::false_type
|
|
|
|
{
|
|
|
|
};
|
|
|
|
template <typename AlgorithmT> struct HasGetTileTurns final : std::false_type
|
|
|
|
{
|
|
|
|
};
|
2017-02-24 21:22:17 -05:00
|
|
|
|
2017-03-31 06:52:04 -04:00
|
|
|
// Algorithms supported by Contraction Hierarchies
|
|
|
|
template <> struct HasAlternativePathSearch<ch::Algorithm> final : std::true_type
|
2017-02-25 00:13:38 -05:00
|
|
|
{
|
|
|
|
};
|
2017-03-31 06:52:04 -04:00
|
|
|
template <> struct HasShortestPathSearch<ch::Algorithm> final : std::true_type
|
2017-02-25 00:13:38 -05:00
|
|
|
{
|
|
|
|
};
|
2017-03-31 06:52:04 -04:00
|
|
|
template <> struct HasDirectShortestPathSearch<ch::Algorithm> final : std::true_type
|
2017-02-25 00:13:38 -05:00
|
|
|
{
|
|
|
|
};
|
2017-03-31 06:52:04 -04:00
|
|
|
template <> struct HasMapMatching<ch::Algorithm> final : std::true_type
|
2017-02-25 00:13:38 -05:00
|
|
|
{
|
|
|
|
};
|
2017-03-31 06:52:04 -04:00
|
|
|
template <> struct HasManyToManySearch<ch::Algorithm> final : std::true_type
|
2017-02-25 00:13:38 -05:00
|
|
|
{
|
|
|
|
};
|
2017-03-31 06:52:04 -04:00
|
|
|
template <> struct HasGetTileTurns<ch::Algorithm> final : std::true_type
|
2017-02-25 00:13:38 -05:00
|
|
|
{
|
|
|
|
};
|
2017-02-24 21:22:17 -05:00
|
|
|
|
2017-03-31 06:52:04 -04:00
|
|
|
// Algorithms supported by Contraction Hierarchies with core
|
2017-03-31 09:19:21 -04:00
|
|
|
// the rest is disabled because of performance reasons
|
2017-03-31 06:52:04 -04:00
|
|
|
template <> struct HasShortestPathSearch<corech::Algorithm> final : std::true_type
|
2017-02-25 00:13:38 -05:00
|
|
|
{
|
|
|
|
};
|
2017-03-31 06:52:04 -04:00
|
|
|
template <> struct HasDirectShortestPathSearch<corech::Algorithm> final : std::true_type
|
2017-02-25 00:13:38 -05:00
|
|
|
{
|
|
|
|
};
|
2017-03-31 06:52:04 -04:00
|
|
|
template <> struct HasMapMatching<corech::Algorithm> final : std::true_type
|
2017-02-25 00:13:38 -05:00
|
|
|
{
|
|
|
|
};
|
2017-03-31 06:52:04 -04:00
|
|
|
template <> struct HasGetTileTurns<corech::Algorithm> final : std::true_type
|
2017-02-25 00:13:38 -05:00
|
|
|
{
|
|
|
|
};
|
2017-03-01 15:29:04 -05:00
|
|
|
|
2017-03-31 06:52:04 -04:00
|
|
|
// Algorithms supported by Multi-Level Dijkstra
|
|
|
|
template <> struct HasDirectShortestPathSearch<mld::Algorithm> final : std::true_type
|
2017-03-01 15:29:04 -05:00
|
|
|
{
|
|
|
|
};
|
2017-04-03 06:50:37 -04:00
|
|
|
template <> struct HasShortestPathSearch<mld::Algorithm> final : std::true_type
|
|
|
|
{
|
|
|
|
};
|
2017-03-31 05:29:48 -04:00
|
|
|
template <> struct HasMapMatching<mld::Algorithm> final : std::true_type
|
|
|
|
{
|
|
|
|
};
|
2017-06-27 10:56:43 -04:00
|
|
|
template <> struct HasManyToManySearch<mld::Algorithm> final : std::true_type
|
|
|
|
{
|
|
|
|
};
|
2017-06-15 07:59:44 -04:00
|
|
|
template <> struct HasGetTileTurns<mld::Algorithm> final : std::true_type
|
|
|
|
{
|
|
|
|
};
|
2017-01-09 15:40:33 -05:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
#endif
|