Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mapsme/omim.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'routing/routing_tests/routing_algorithm.hpp')
-rw-r--r--routing/routing_tests/routing_algorithm.hpp55
1 files changed, 55 insertions, 0 deletions
diff --git a/routing/routing_tests/routing_algorithm.hpp b/routing/routing_tests/routing_algorithm.hpp
new file mode 100644
index 0000000000..e1eb72467b
--- /dev/null
+++ b/routing/routing_tests/routing_algorithm.hpp
@@ -0,0 +1,55 @@
+#pragma once
+
+#include "routing/base/routing_result.hpp"
+#include "routing/road_graph.hpp"
+#include "routing/router.hpp"
+
+#include "base/cancellable.hpp"
+
+#include "std/functional.hpp"
+#include "std/string.hpp"
+#include "std/vector.hpp"
+
+namespace routing
+{
+
+// IRoutingAlgorithm is an abstract interface of a routing algorithm,
+// which searches the optimal way between two junctions on the graph
+class IRoutingAlgorithm
+{
+public:
+ enum class Result
+ {
+ OK,
+ NoPath,
+ Cancelled
+ };
+
+ virtual Result CalculateRoute(IRoadGraph const & graph, Junction const & startPos,
+ Junction const & finalPos, RouterDelegate const & delegate,
+ RoutingResult<IRoadGraph::Vertex, IRoadGraph::Weight> & path) = 0;
+};
+
+string DebugPrint(IRoutingAlgorithm::Result const & result);
+
+// AStar routing algorithm implementation
+class AStarRoutingAlgorithm : public IRoutingAlgorithm
+{
+public:
+ // IRoutingAlgorithm overrides:
+ Result CalculateRoute(IRoadGraph const & graph, Junction const & startPos,
+ Junction const & finalPos, RouterDelegate const & delegate,
+ RoutingResult<IRoadGraph::Vertex, IRoadGraph::Weight> & path) override;
+};
+
+// AStar-bidirectional routing algorithm implementation
+class AStarBidirectionalRoutingAlgorithm : public IRoutingAlgorithm
+{
+public:
+ // IRoutingAlgorithm overrides:
+ Result CalculateRoute(IRoadGraph const & graph, Junction const & startPos,
+ Junction const & finalPos, RouterDelegate const & delegate,
+ RoutingResult<IRoadGraph::Vertex, IRoadGraph::Weight> & path) override;
+};
+
+} // namespace routing