diff options
author | ymherklotz <ymherklotz@gmail.com> | 2016-12-11 12:18:53 +0000 |
---|---|---|
committer | ymherklotz <ymherklotz@gmail.com> | 2016-12-11 12:18:53 +0000 |
commit | bda878a84a62765875dd316d8280fe1743952aee (patch) | |
tree | 81726ae6da995add2db2b13655dd11ee6c6c380a /include | |
parent | e3c55bd254ef26fc7ef70ad6c78141d1267c1139 (diff) | |
download | A-star-algorithm-bda878a84a62765875dd316d8280fe1743952aee.tar.gz A-star-algorithm-bda878a84a62765875dd316d8280fe1743952aee.zip |
working
Diffstat (limited to 'include')
-rw-r--r-- | include/astar.hpp | 2 | ||||
-rw-r--r-- | include/node.hpp | 28 |
2 files changed, 16 insertions, 14 deletions
diff --git a/include/astar.hpp b/include/astar.hpp index 9071775..30e9d65 100644 --- a/include/astar.hpp +++ b/include/astar.hpp @@ -41,6 +41,8 @@ private: bool check_item_vec(const Node& n); int get_index_vec(const Node& n); void remove_from_vec(const Node& n); + + Node find_node(const unsigned int& x, const unsigned int& y); }; #endif // ASTAR_HPP diff --git a/include/node.hpp b/include/node.hpp index 4b19560..f126fc4 100644 --- a/include/node.hpp +++ b/include/node.hpp @@ -19,26 +19,26 @@ public: friend bool operator!=(const Node& n1, const Node& n2); friend std::ostream& operator<<(std::ostream& out, const Node& n); private: -// pointer to previous node so that I can backtrack without using recursion. - Node *previous_node; -// pointers to the next nodes of which there are 4 in a grid. -// We do not need this as we are implementing a priority queue; -//Node *next_nodes[NEIGHBOUR_NUM]; - -// score that is used to compare to other nodes to see if the other path is -// more efficient. + // pointer to previous node so that I can backtrack without using recursion. + int x_prev, y_prev; + // pointers to the next nodes of which there are 4 in a grid. + // We do not need this as we are implementing a priority queue; + //Node *next_nodes[NEIGHBOUR_NUM]; + + // score that is used to compare to other nodes to see if the other path is + // more efficient. int f_score; -// path length to get to that node. + // path length to get to that node. int g_score; -// heuristic length to destination. + // heuristic length to destination. int h_score; -// the x and y coordinates of the node in the grid + // the x and y coordinates of the node in the grid int x, y; -// see if node has been visited. -// We don't need this as we will have an open and a closed set -//bool visited; + // see if node has been visited. + // We don't need this as we will have an open and a closed set + //bool visited; }; #endif // NODE_HPP |