easylocal::cli::run
Runs application as a program, from the command line to the solution.
Synopsis
Declared in <easylocal/app/cli.hpp>
template<class App>
[[nodiscard]]
int
run(
App application,
int const argc,
char* argv[],
options settings = {});
Description
It parses argc and argv (and a --config file), loads the Input, starts from a random, initial or loaded solution, runs the chosen runner and prints "cost", "time" (the seconds of the run, the binding of the app for it included), the effort of the run ("iterations", "evaluations", "termination") when the algorithm reports it, with --report the value of each cost component, and the solution, or saves it to --output. After a run with a cost::pareto cost it prints "front" and its size, then each point, "point", its number and "cost", followed by its solution, or saves the solutions to numbered files next to --output.
With --tuning.print=cost it prints only the cost as one number (scalar_cost), and the running time after it with cost_time; with --tuning.irace=DIR it writes an irace scenario to DIR (write_irace_stub), with the ranges of settings.tuning, and exits without loading the Input.
Returns the exit status: 0 on success, 1 when the run fails (an unreadable or unwritable file, or any other exception), 2 for an invalid command line, a --solution that is not valid for the Input and an option the problem cannot honour (--solution or --output without the I/O hooks, a --start it has no solutions for) included, which are checked before the Input is read. Every error is printed after error: .
Return Value
NOTE
The return value should not be discarded.