CSCI3081W Drone Delivery System
AStar.h
1 #ifndef ASTAR_H_
2 #define ASTAR_H_
3 
4 #include <functional>
5 
6 #include "Graph.h"
7 #include "RoutingStrategy.h"
8 
9 namespace routing {
10 class AStar : public RoutingStrategy {
11  protected:
12  std::function<double(const GraphNode&, const GraphNode&)> heuristic;
13 
14  public:
15  AStar(std::function<double(const GraphNode&, const GraphNode&)> h =
16  [](const GraphNode& n1, const GraphNode& n2) {
17  return n1.getPosition().dist(n2.getPosition());
18  })
19  : heuristic(h) {}
20  std::optional<std::vector<int>> getPath(const Graph&, int, int) const;
21 };
22 } // namespace routing
23 
24 #endif // ASTAR_H_
Definition: AStar.h:10
Definition: Graph.h:12
Definition: Graph.h:23
Definition: RoutingStrategy.h:9