forked from PathPlanning/3D-AStar-ThetaStar
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Queues.h
74 lines (48 loc) · 1.27 KB
/
Queues.h
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
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
#ifndef QUEUES_H
#define QUEUES_H
#include <list>
#include <vector>
#include <unordered_set>
#include "node.h"
class iOpen {
protected:
virtual bool less(const Node &x, const Node &y) const;
int breaking_tie;
public:
iOpen() {};
virtual bool Insert(const Node &NewNode) = 0;
virtual Node FindMin() const = 0;
virtual void DeleteMin() = 0;
virtual size_t size() const = 0;
virtual bool empty() const = 0;
};
class SortedList : public iOpen {
private:
std::vector<std::list<Node>> data;
size_t size_;
mutable size_t min_pos;
public:
SortedList() = default;
SortedList(size_t size, int brakingtie);
virtual bool Insert(const Node &NewNode);
virtual Node FindMin() const;
virtual void DeleteMin();
virtual size_t size() const;
virtual bool empty() const;
};
class ClusteredSets : public iOpen {
private:
std::vector<Node> loc_mins;
std::vector<std::unordered_set<Node>> data;
size_t size_;
mutable size_t min_pos;
public:
ClusteredSets() = default;
ClusteredSets(size_t size, int breakingtie);
virtual bool Insert(const Node &NewNode);
virtual Node FindMin() const;
virtual void DeleteMin();
virtual size_t size() const;
virtual bool empty() const;
};
#endif