-
Notifications
You must be signed in to change notification settings - Fork 13
/
sipp.h
44 lines (40 loc) · 2.3 KB
/
sipp.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
#ifndef SIPP_H
#define SIPP_H
#include "astar.h"
#include "sipp_node.h"
#include "zero_scipp_node.h"
template <typename NodeType = SIPPNode>
class SIPP : virtual public Astar<NodeType>
{
public:
SIPP(double HW = 1.0, bool BT = true) : Astar<NodeType>(true, HW, BT) {}
SIPP(SIPP& other) = default;
SIPP& operator=(SIPP& other) = default;
SIPP(SIPP&& other) = default;
SIPP& operator=(SIPP&& other) = default;
virtual ~SIPP() {}
protected:
void setEndTime(NodeType& node, int start_i, int start_j, int startTime, int agentId, const ConstraintsSet &constraints) override;
void createSuccessorsFromNode(const NodeType &cur, NodeType &neigh, std::list<NodeType> &successors,
int agentId, const ConstraintsSet &constraints,
const ConflictAvoidanceTable &CAT, bool isGoal) override;
bool checkGoal(const NodeType &cur, int goalTime, int agentId, const ConstraintsSet &constraints) override;
virtual void splitBySoftConflicts(std::vector<std::pair<int, int>> &softConflictIntervals,
const NodeType & node, const NodeType &prevNode, std::pair<int, int> interval,
const ConflictAvoidanceTable &CAT);
virtual void setNeighG(const NodeType &cur, NodeType &neigh,
int agentId, const ConstraintsSet &constraints);
virtual void addOptimalNode(const NodeType& cur, NodeType &neigh, std::pair<int, int> interval,
int agentId, const ConstraintsSet &constraints,
std::list<NodeType> &successors) {}
virtual bool getOptimal(const NodeType &neigh) { return false; }
virtual void setOptimal(NodeType &neigh, bool val) {}
virtual bool checkSuboptimal(const NodeType &cur) { return true; }
virtual bool canStay() override { return false; }
virtual bool withZeroConflicts() { return false; }
virtual void updateEndTimeBySoftConflicts(NodeType &node, const ConflictAvoidanceTable &CAT);
virtual void createNeighborsByEdges(const NodeType &cur, NodeType &neigh,
std::list<NodeType> &successors, int agentId,
const ConstraintsSet &constraints, const ConflictAvoidanceTable &CAT);
};
#endif // SIPP_H