forked from bagrorg/Bi-criteria-Search-Algorithms
-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.cpp
49 lines (41 loc) · 1.6 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
#include <boost/program_options.hpp>
#include "Service/Options.hpp"
#include "Service/Measurements.hpp"
#include "Service/AlgorithmSet.hpp"
#include <iostream>
using namespace std;
namespace po = boost::program_options;
int main(int argc, char** argv) {
// Declare the supported options.
po::options_description desc("Allowed options");
desc.add_options()
("help", "produce help message")
("algo", po::value<std::string>(), "algorithm name")
("report_path", po::value<std::string>(), "report file path")
("graph_path", po::value<std::string>(), "path to graph file")
("iterations", po::value<size_t>(), "count of iterations")
("eps_dist", po::value<float>(), "eps distance")
("eps_time", po::value<float>(), "eps time")
("start_id", po::value<int>(), "id of start")
("goal_id", po::value<int>(), "id of goal")
("history_path", po::value<std::string>(), "path to history")
("h_time_path", po::value<std::string>(), "path to heuristic by time")
("h_dist_path", po::value<std::string>(), "path to heuristic by distance")
("solution_path", po::value<std::string>(), "path to result solution")
;
po::variables_map vm;
po::store(po::parse_command_line(argc, argv, desc), vm);
po::notify(vm);
if (vm.count("help")) {
cout << desc << "\n";
return 1;
}
Options opts = optionsFromInput(vm);
AlgorithmSet as;
build(as, opts);
if (vm.count("algo")) {
auto a = as[vm["algo"].as<std::string>()];
a->runAlgorithm(opts);
a->writeReport(opts);
}
}