aboutsummaryrefslogtreecommitdiffstats
path: root/include/astar.hpp
blob: a3d2178bbb9bb946ee229dcf11f23f1c1926a7eb (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
#ifndef ASTAR_HPP
#define ASTAR_HPP

#include "priority_queue.hpp"
#include "node.hpp"

#include <ostream>
#include <vector>

// defines the number of nodes one can go to
// we don't need this as we will have the queues
//#define NEIGHBOUR_NUM 4

// TODO add constructors and functions to calculate heuristics etc..
class AStar {
public:
	AStar(int *curr_graph, const unsigned int& width, const unsigned int& height);
private:
	PriorityQueue<Node> open_set;
	std::vector<Node> closed_set;

	int *graph;
	int graph_width;
	int graph_height;

	Node current_node, start_node, end_node;

	void set_start_end();

	Node get_neighbour(const Node& n_in, const int& neighbour_num);

	void calc_heuristic(Node& n);
};

#endif // ASTAR_HPP