-
Notifications
You must be signed in to change notification settings - Fork 55
/
Copy pathmain.cpp
40 lines (38 loc) · 1.42 KB
/
main.cpp
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
#include <iostream>
#include <fstream>
#include "map.h"
#include "task.h"
#include "cbs.h"
#include "xml_logger.h"
int main(int argc, const char *argv[])
{
if(argc > 2)
{
Config config;
if(argc > 3)
config.getConfig(argv[3]);
Map map = Map(config.agent_size, config.connectdness);
map.get_map(argv[1]);
Task task;
task.get_task(argv[2]);
if(map.is_roadmap())
task.make_ij(map);
else
task.make_ids(map.get_width());
CBS cbs;
Solution solution = cbs.find_solution(map, task, config);
XML_logger logger;
auto found = solution.found?"true":"false";
std::cout<< "Soulution found: " << found << "\nRuntime: "<<solution.time.count() << "\nMakespan: " << solution.makespan << "\nFlowtime: " << solution.flowtime<< "\nInitial Cost: "<<solution.init_cost<< "\nCollision Checking Time: " << solution.check_time
<< "\nHL expanded: " << solution.high_level_expanded << "\nLL searches: " << solution.low_level_expansions << "\nLL expanded(avg): " << solution.low_level_expanded << std::endl;
logger.get_log(argv[2]);
logger.write_to_log_summary(solution);
logger.write_to_log_path(solution, map);
logger.save_log();
}
else
{
std::cout<<"Error! Not enough input parameters are specified!\n";
}
return 0;
}