-
Notifications
You must be signed in to change notification settings - Fork 5
Expand file tree
/
Copy pathastar.h
More file actions
44 lines (36 loc) · 1.52 KB
/
astar.h
File metadata and controls
44 lines (36 loc) · 1.52 KB
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
#ifndef ASTAR_H
#define ASTAR_H
#include "ilogger.h"
#include "searchresult.h"
#include "environmentoptions.h"
#include <list>
#include <unordered_map>
#include <vector>
#include <math.h>
#include <limits>
#include <chrono>
class Astar
{
public:
Astar();
Astar(double HW, bool BT);
virtual ~Astar(void);
SearchResult startSearch(ILogger *Logger, const Map &Map, const EnvironmentOptions &options);
protected:
ANode findMin();
void addOpen(ANode newNode);
double computeHFromCellToCell(int start_i, int start_j, int fin_i, int fin_j, const EnvironmentOptions &options);
std::list<ANode> findSuccessors(ANode curNode, const Map &map, const EnvironmentOptions &options);
void makePrimaryPath(ANode curNode);//Makes path using back pointers
void makeSecondaryPath();//Makes another type of path(sections or points)
ANode resetParent(ANode current, ANode parent, const Map &map, const EnvironmentOptions &options) {return current;}//Function for Theta*
bool stopCriterion();
SearchResult sresult;
std::list<ANode> lppath, hppath;
std::unordered_map<int,ANode> close;
std::vector<std::list<ANode>> open;
int openSize;
double hweight;//weight of h-value
bool breakingties;//flag that sets the priority of nodes in addOpen function when their F-values is equal
};
#endif