forked from DEIS-Tools/Swarm-Robotics
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmap_structure.h
62 lines (48 loc) · 1.86 KB
/
map_structure.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
#ifndef MAP_STRUCTURE
#define MAP_STRUCTURE
#include "nlohmann/json.hpp"
#include "Models/Figure.hpp"
//using namespace std;
class Map_Structure {
public:
std::vector<std::shared_ptr<Point>> stations;
std::vector<std::shared_ptr<Point>> points;
std::vector<Line> lines;
std::vector<std::shared_ptr<Figure>> figures;
std::vector<std::shared_ptr<Line>> hardLines;
//ID's of all stations
std::vector<int> stationIDs;
//ID's of all drop points aka end stations
std::vector<int> endStationIDs;
//Storage of shortest distances between all vias
std::vector<std::vector<int>> shortestPath;
//Storage of shortest distances between all stations
std::vector<std::vector<float>> shortestDistances;
//singleton of map_structure
static Map_Structure &get_instance() {
static Map_Structure instance;
return instance;
}
//Collects each figure vias
void collectAllWayPoints();
// creates static_config json file for Uppaal
void createStaticJSON(const std::string& path);
//calculates and returns shortest distances between all stations as well as
//stores all shortest paths between all vias
vector<vector<float>> floydShortest(int amountOfStations);
// Combines from all the points all possibleStaticMap::lines
void setAllPossibleLines(float mapSize);
// Functions eliminates all theStaticMap::lines which have intersection
void eliminateBadLines(std::vector<shared_ptr<Line>>& hardLines, vector<Line>& lines);
//function which return shortest path between two points
std::vector<Point> findPath(int startId, int destinationId);
// reads Data/points.json file and initializes the stations
void initializeStations(const std::string& path);
//Assistant function for floyd shortest path
vector<vector<float>> createCopyList();
//sorts all the lines in order
void sortLines();
private:
Map_Structure() = default;
};
#endif