-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcli.cc
46 lines (41 loc) · 2.06 KB
/
cli.cc
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
#include "cli.hpp"
#include "options.hpp"
#include <boost/program_options/value_semantic.hpp>
namespace po = boost::program_options;
po::options_description
generate_main_options(command_line_options &o)
{
po::options_description options("Simulation options");
options.add_options()("help", "Display help");
options.add_options()("N", po::value<decltype(command_line_options::N)>(&o.N),
"Diploid population size. Default = 1000.");
options.add_options()(
"psurvival", po::value<decltype(command_line_options::psurvival)>(&o.psurvival),
"Survival probability. Default = 0.0");
options.add_options()("nsteps",
po::value<decltype(command_line_options::nsteps)>(&o.nsteps),
"Number of time steps to evolve. Default = 1000.");
options.add_options()(
"simplify",
po::value<decltype(command_line_options::simplification_interval)>(
&o.simplification_interval),
"Time steps between simplifications. Default = 100.");
options.add_options()("rho", po::value<decltype(command_line_options::rho)>(&o.rho),
"Scaled recombination rate, 4Nr. Default=0.");
options.add_options()(
"treefile", po::value<decltype(command_line_options::treefile)>(&o.treefile),
"Ouput file name. Default = treefile.trees");
options.add_options()(
"buffer", po::bool_switch(&o.buffer_new_edges),
"If true, use edge buffering algorithm. If not, sort and simplify. Default = "
"false");
options.add_options()("cppsort", po::bool_switch(&o.cppsort),
"If true, sort edges in C++. Not used with --buffer");
options.add_options()(
"parallel_sort", po::bool_switch(&o.parallel_sort),
"If true, and also using --cppsort, sort edges with parallel method");
options.add_options()("seed",
po::value<decltype(command_line_options::seed)>(&o.seed),
"Random number seed. Default = 42.");
return options;
}