Skip to content

Commit

Permalink
Allow overriding nb_searches and depth for debug purposes.
Browse files Browse the repository at this point in the history
  • Loading branch information
jcoupey committed May 24, 2024
1 parent 44bd7e4 commit 8c09577
Showing 1 changed file with 16 additions and 1 deletion.
17 changes: 16 additions & 1 deletion src/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -86,13 +86,22 @@ int main(int argc, char** argv) {
cxxopts::value<std::string>(cl_args.input));

// we don't want to print debug args on --help
std::optional<unsigned> debug_depth;
std::optional<unsigned> debug_nb_searches;

options.add_options("debug_group")
("e,heuristic-param",
"Heuristic parameter",
cxxopts::value<std::vector<std::string>>(heuristic_params_arg))
("f,apply-tsp-fix",
"apply experimental TSPFix local search operator",
cxxopts::value<bool>(cl_args.apply_TSPFix)->default_value("false"));
cxxopts::value<bool>(cl_args.apply_TSPFix)->default_value("false"))
("d,depth",
"search depth",
cxxopts::value<std::optional<unsigned>>(debug_depth))
("s,nb-searches",
"number of searches to perform in parallel",
cxxopts::value<std::optional<unsigned>>(debug_nb_searches));

// clang-format on
try {
Expand Down Expand Up @@ -156,6 +165,12 @@ int main(int argc, char** argv) {
}
exploration_level = std::min(exploration_level, vroom::MAX_EXPLORATION_LEVEL);
vroom::io::set_exploration_level(cl_args, exploration_level);
if (debug_depth) {
cl_args.depth = debug_depth.value();
}
if (debug_nb_searches) {
cl_args.nb_searches = debug_nb_searches.value();
}

// Determine routing engine (defaults to ROUTER::OSRM).
if (router_arg == "libosrm") {
Expand Down

0 comments on commit 8c09577

Please sign in to comment.