-
Notifications
You must be signed in to change notification settings - Fork 13
/
Copy pathreplanning_focal_search.h
52 lines (42 loc) · 2.07 KB
/
replanning_focal_search.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
#ifndef REPLANNINGFOCALSEARCH_H
#define REPLANNINGFOCALSEARCH_H
#include "replanning_astar.h"
#include "replanning_fs_node.h"
template <typename NodeType = ReplanningFSNode>
class ReplanningFocalSearch : virtual public ReplanningAStar<NodeType>
{
public:
ReplanningFocalSearch(bool WithTime = false, double FocalW = 1.0, double HW = 1.0, bool BT = true);
ReplanningFocalSearch(ReplanningFocalSearch& other) = default;
ReplanningFocalSearch& operator=(ReplanningFocalSearch& other) = default;
ReplanningFocalSearch(ReplanningFocalSearch&& other) = default;
ReplanningFocalSearch& operator=(ReplanningFocalSearch&& other) = default;
virtual ~ReplanningFocalSearch() {}
//virtual void updateFocalW(double newFocalW, const Map& map) override;
void clearLists() override;
void updateNode(NodeType &node, const Map &map,
int goal_i, int goal_j, int agentId,
const std::unordered_set<Node, NodeHash> &occupiedNodes,
const ConstraintsSet &constraints,
bool withCAT, const ConflictAvoidanceTable &CAT,
std::queue<NodeType>& queue, std::unordered_set<int>& addedNodesConv) override;
void updateFocalW(double newFocalW, const Map& map) override;
void filterFocalNodes(double minF);
void checkMinFChange() override;
static int Time;
protected:
bool checkOpenEmpty() override;
NodeType getCur(const Map& map) override;
virtual void removeCur(const NodeType& cur, const Map& map) override;
double getMinFocalF() override;
virtual void setHC(NodeType &neigh, const NodeType &cur,
const ConflictAvoidanceTable &CAT, bool isGoal) override;
virtual int getFocalSize() override { return focal.size(); }
virtual void removeUnexpandedNode(const NodeType& node);
int getPredConflictsCount(const NodeType& node, const NodeType& pred,
const ConflictAvoidanceTable& CAT) const { return pred.hc + CAT.getEdgeAgentsCount(node, pred); };
std::set<NodeType, bool (*)(const NodeType&, const NodeType&)> focal;
std::multiset<double> focalF;
double focalW;
};
#endif // REPLANNINGFOCALSEARCH_H