-
Notifications
You must be signed in to change notification settings - Fork 3
/
conflict_avoidance_table.h
35 lines (31 loc) · 1.3 KB
/
conflict_avoidance_table.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
#ifndef CONFLICTAVOIDANCETABLE_H
#define CONFLICTAVOIDANCETABLE_H
#include <unordered_map>
#include <list>
#include "node.h"
#include "map.h"
#include "search_queue.h"
#include "motion_primitives.h"
#include <boost/icl/interval_map.hpp>
class ConflictAvoidanceTable
{
public:
void addCell(const Cell &cell);
void addAgentPath(const std::list<Node>::const_iterator& start,
const std::list<Node>::const_iterator& end,
const Primitives *mp);
void removeCell(const Cell &cell);
void removeAgentPath(const std::list<Node>::const_iterator& start,
const std::list<Node>::const_iterator& end,
const Primitives *mp);
int getFirstSoftConflict(const Node & node, int startTime, int endTime) const;
void getSoftConflictIntervals(std::vector<std::pair<int, int>> &res, const Node & node,
int startTime, int endTime, int duration, bool firstCell) const;
void getCells(std::vector<Cell> &cells,
const std::list<Node>::const_iterator& start,
const std::list<Node>::const_iterator& end,
const Primitives *mp);
private:
std::map<std::pair<int, int>, boost::icl::interval_map<int, int>> intervals;
};
#endif // CONFLICTAVOIDANCETABLE_H