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:
authorMikhail Gorbushin <m.gorbushin@corp.mail.ru>2019-03-22 19:32:24 +0300
committerVladimir Byko-Ianko <bykoianko@gmail.com>2019-04-01 17:12:51 +0300
commit9cc034a71703395ea9ee5f9da344bb9e20fcd260 (patch)
tree7bacd908672870c6441a81464722ceecc7f8a3ce /generator
parenta896d48a199a2bbfe3b1d8856b24918755ba1a97 (diff)
[routing] create interface for graph to AStar
Diffstat (limited to 'generator')
-rw-r--r--generator/routing_index_generator.cpp13
1 files changed, 8 insertions, 5 deletions
diff --git a/generator/routing_index_generator.cpp b/generator/routing_index_generator.cpp
index 3d57630bef..48726a614c 100644
--- a/generator/routing_index_generator.cpp
+++ b/generator/routing_index_generator.cpp
@@ -5,6 +5,8 @@
#include "generator/routing_helpers.hpp"
#include "routing/base/astar_algorithm.hpp"
+#include "routing/base/astar_graph.hpp"
+
#include "routing/cross_mwm_connector.hpp"
#include "routing/cross_mwm_connector_serialization.hpp"
#include "routing/cross_mwm_ids.hpp"
@@ -201,13 +203,13 @@ private:
Segment m_start;
};
-class DijkstraWrapperJoints final
+class DijkstraWrapper : public AStarGraph<Segment, SegmentEdge, RouteWeight>
{
public:
// AStarAlgorithm types aliases:
- using Vertex = JointSegment;
- using Edge = JointEdge;
- using Weight = RouteWeight;
+ using Vertex = AStarGraph::Vertex;
+ using Edge = AStarGraph::Edge;
+ using Weight = AStarGraph::Weight;
explicit DijkstraWrapperJoints(IndexGraphWrapper & graph, Segment const & start)
: m_graph(graph, start) {}
@@ -465,8 +467,9 @@ void FillWeights(string const & path, string const & mwmFile, string const & cou
Segment const & enter = connector.GetEnter(i);
+ using Algorithm = AStarAlgorithm<JointSegment, JointEdge, RouteWeight>;
- AStarAlgorithm<DijkstraWrapperJoints> astar;
+ Algorithm astar;
IndexGraphWrapper indexGraphWrapper(graph, enter);
DijkstraWrapperJoints wrapper(indexGraphWrapper, enter);
AStarAlgorithm<DijkstraWrapperJoints>::Context context;