5 #include "core/LongOptions.h" 6 #include "core/Arguments.h" 9 #include "ABCRejectionController.h" 15 R
"(* Help message for 'rejection' controller * 18 The ABC rejection method samples candidate parameters from the stdout of 19 'prior_sampler'. For every candidate parameter, 'simulator' is invoked and 20 given two lines as its input; the first line contains 'epsilon' and the 21 second line contains the candidate parameter. 23 The output of 'simulator' indicates whether the parameter was accepted or 24 rejected; an output of '0', 'reject' or 'rejected' means that the parameter 25 was rejected and an output of '1', 'accept' or 'accepted' means that the 26 parameter was accepted. 28 Upon completion, the controller outputs the parameter names, followed by 29 newline-separated list of accepted parameters. 32 -N, --number-accept=NUM NUM is number of parameters to accept 33 -E, --epsilon=EPS EPS is the tolerance passed to 'simulator' 34 -P, --parameter-names=NAMES NAMES is a comma-separated list of 36 -S, --simulator=CMD CMD is simulator command 37 -R, --prior-sampler=CMD CMD is prior_sampler command 44 lopts.
add({
"number-accept", required_argument,
nullptr,
'N'});
45 lopts.
add({
"epsilon", required_argument,
nullptr,
'E'});
46 lopts.
add({
"parameter-names", required_argument,
nullptr,
'P'});
47 lopts.
add({
"simulator", required_argument,
nullptr,
'S'});
48 lopts.
add({
"prior-sampler", required_argument,
nullptr,
'R'});
87 catch (
const std::out_of_range& e)
89 std::string error_msg;
90 error_msg +=
"Out of range: ";
91 error_msg += e.what();
93 error_msg +=
"One or more arguments missing or incorrect, try '";
95 error_msg +=
" rejection --help' for more info";
96 throw std::runtime_error(error_msg);
98 catch (
const std::invalid_argument& e)
100 std::string error_msg;
101 error_msg +=
" Invalid argument: ";
102 error_msg += e.what();
104 error_msg +=
"One or more arguments missing or incorrect, try '";
106 error_msg +=
" rejection --help' for more info";
107 throw std::runtime_error(error_msg);
static std::string help()
const char * g_program_name
static ABCRejectionController * makeController(const Arguments &args)
static void addLongOptions(LongOptions &lopts)
void add(struct option long_opt)
ABCRejectionController(const Input &input_obj)
std::string optionalArgument(const std::string &option_name) const