-
Notifications
You must be signed in to change notification settings - Fork 6
/
main.cpp
52 lines (41 loc) · 1.69 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
41
42
43
44
45
46
47
48
49
50
51
#include <iostream>
#include "mission.h"
int main(int argc, char *argv[])
{
if(argc < 2) {
std::cout<<"Error! Pathfinding task file (XML) is not specified!"<<std::endl;
return 0;
}
Mission mission(argv[1]);
std::cout<<argv[1]<<std::endl;
std::cout<<"Parsing the map from XML:"<<std::endl;
if(!mission.getMap()) {
std::cout<<"Incorrect map! Program halted!"<<std::endl;
}
else {
std::cout<<"Map OK!"<<std::endl<<"Parsing configurations (algorithm, log) from XML:"<<std::endl;
if(!mission.getConfig())
std::cout<<"Incorrect configurations! Program halted!"<<std::endl;
else {
std::cout<<"Configurations OK!"<<std::endl<<"Creating local Map:"<<std::endl;
if(!mission.getLocalMap())
std::cout<<"Incorrect map! Program halted!"<<std::endl;
else {
std::cout<<"Configurations OK!"<<std::endl<<"Creating logchannel:"<<std::endl;
if(!mission.createLog())
std::cout<<"Log chanel has not been created! Program halted!"<<std::endl;
else {
std::cout<<"Log OK!"<<std::endl<<"Start searching the path:"<<std::endl;
mission.createEnvironmentOptions();
mission.createSearch();
mission.startSearch();
std::cout<<"Search is finished!"<<std::endl;
mission.printSearchResultsToConsole();
mission.saveSearchResultsToLog();
std::cout<<"Results are saved (if chosen) via created log channel."<<std::endl;
}
}
}
}
return 0;
}