-
Notifications
You must be signed in to change notification settings - Fork 1
/
mission.h
79 lines (71 loc) · 2.88 KB
/
mission.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
75
76
77
78
#ifndef MISSION_H
#define MISSION_H
#include "map.h"
#include "agent_set.h"
#include "push_and_rotate.h"
#include "conflict_based_search.h"
#include "anytime_cbs.h"
#include "prioritized_planning.h"
#include "config.h"
#include "isearch.h"
#include "ilogger.h"
#include "searchresult.h"
#include "astar.h"
#include "dijkstra.h"
#include "sipp.h"
#include "zero_scipp.h"
#include "focalsearch.h"
#include "scipp.h"
#include "xmllogger.h"
#include "multiagent_search_interface.h"
#include "testing_results.h"
#include <algorithm>
//That's the wrap up class that first creates all the needed objects (Map, Search etc.)
//and then runs the search and then cleans everything up.
//Hint: Create Mission object in the main() function and then use it 1) to retreive all the data from input XML
//2) run the search 3) flush the results to output XML
class Mission
{
public:
Mission();
Mission (const char* MapFile);
~Mission();
bool getMap();
bool getAgents(const char* agentsFile);
bool getConfig();
bool createLog();
// void createSearch();
void createAlgorithm();
void createEnvironmentOptions();
bool checkAgentsCorrectness(const std::string &agentsFile);
void startSearch(const std::string &agentsFile);
void printSearchResultsToConsole();
void saveSearchResultsToLog();
void saveAgentsPathsToLog(const std::string &agentsFile, double time, double makespan, double flowtime,
int HLExpansions, int HLNodes, double LLExpansions, double LLNodes);
void saveSingleResultToLog(const std::string &agentsFile, int agents, double time, double makespan, double flowtime,
int HLExpansions, int HLNodes, double LLExpansions, double LLNodes, double initCost);
bool checkCorrectness();
void saveAggregatedResultsToLog();
void saveSeparateResultsToLog();
std::pair<int, int> getCosts();
int getTasksCount();
std::string getAgentsFile();
bool getSingleExecution();
bool getSaveAggregatedResults() { return config.saveAggregatedResults; }
private:
Map map;
AgentSet agentSet;
Config config;
int searchType;
MultiagentSearchInterface* multiagentSearch;
ILogger* logger;
const char* mapFile;
MultiagentSearchResult sr;
std::vector<std::vector<Node>> agentsPaths;
std::vector<TestingResults> testingResults;
//std::map<int, std::vector<int>> makespans;
//std::map<int, std::vector<int>> flowtimes;
//std::map<int, std::vector<double>> times;
};
#endif