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

routing_algorithm.hpp « routing - github.com/mapsme/omim.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 437494734e2c9d4e40b2009191db5038a093d834 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
#pragma once

#include "base/cancellable.hpp"

#include "routing/road_graph.hpp"
#include "routing/router.hpp"
#include "routing/base/astar_algorithm.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<Junction> & 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<Junction> & 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<Junction> & path) override;
};

}  // namespace routing