From fea5d4c3a84e3d83ed761579a7a7cc31279cc165 Mon Sep 17 00:00:00 2001 From: Charlie Blake Date: Wed, 20 Jun 2018 15:43:21 +0100 Subject: Set solver seed limit --- src/main/input-output/input/command_line_helper.cpp | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) (limited to 'src/main/input-output/input/command_line_helper.cpp') diff --git a/src/main/input-output/input/command_line_helper.cpp b/src/main/input-output/input/command_line_helper.cpp index 2abef54..21eec88 100644 --- a/src/main/input-output/input/command_line_helper.cpp +++ b/src/main/input-output/input/command_line_helper.cpp @@ -38,12 +38,13 @@ command_line_helper::command_line_helper() "'solvability', 'benchmark' or list of deals to be solved.") ("classify", "outputs a simple 'solvable/not solvable' " "classification") - ("cache-capacity", po::value(), "sets an upper bound on the number of states allowed in " + ("cache-capacity", po::value(), "sets an upper bound on the number of states allowed in " "the cache") ("solvability", po::value(), "calculates the solvability " - "percentage of the supplied solitaire game, given a timeout in milliseconds. Must supply " + "percentage of the supplied solitaire game, given a limit for the number of seeds. Must supply " "either 'random', 'benchmark', 'solvability' or list of deals to be " "solved.") + ("timeout", po::value(), "adds a per-game timeout to the solvability percentage generation") ("resume", po::value>()->multitoken(), "resumes the solvability percentage calculation from a " "previous run. Must be supplied with the solvability option. " "Syntax: [sol unsol intract in-progress-1 in-progress-2 ...]") @@ -121,6 +122,12 @@ bool command_line_helper::parse(int argc, const char* argv[]) { solvability = -1; } + if (vm.count("timeout")) { + timeout = vm["timeout"].as(); + } else { + timeout = 604800000; // 1 week in milliseconds + } + if (vm.count("cores")) { cores = vm["cores"].as(); } else { @@ -248,6 +255,10 @@ int command_line_helper::get_solvability() { return solvability; } +uint64_t command_line_helper::get_timeout() { + return timeout; +} + vector command_line_helper::get_resume() { return resume; } -- cgit v1.2.1 From abae8e0529cf2e6048e9b2eb8248434e1f9551de Mon Sep 17 00:00:00 2001 From: Charlie Blake Date: Wed, 20 Jun 2018 17:37:22 +0100 Subject: Add streamliner command line option (inc for spgs) --- src/main/input-output/input/command_line_helper.cpp | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) (limited to 'src/main/input-output/input/command_line_helper.cpp') diff --git a/src/main/input-output/input/command_line_helper.cpp b/src/main/input-output/input/command_line_helper.cpp index 21eec88..ec9a375 100644 --- a/src/main/input-output/input/command_line_helper.cpp +++ b/src/main/input-output/input/command_line_helper.cpp @@ -38,18 +38,20 @@ command_line_helper::command_line_helper() "'solvability', 'benchmark' or list of deals to be solved.") ("classify", "outputs a simple 'solvable/not solvable' " "classification") - ("cache-capacity", po::value(), "sets an upper bound on the number of states allowed in " + ("cache-capacity", po::value(), "sets an upper bound on the number of states allowed in " "the cache") ("solvability", po::value(), "calculates the solvability " "percentage of the supplied solitaire game, given a limit for the number of seeds. Must supply " - "either 'random', 'benchmark', 'solvability' or list of deals to be " - "solved.") + "either 'random', 'benchmark', 'solvability' or list of deals to be solved.") ("timeout", po::value(), "adds a per-game timeout to the solvability percentage generation") ("resume", po::value>()->multitoken(), "resumes the solvability percentage calculation from a " "previous run. Must be supplied with the solvability option. " "Syntax: [sol unsol intract in-progress-1 in-progress-2 ...]") ("cores", po::value(), "the number of cores for the solvability percentages to be run across. " - "Must be supplied with the solvability option.") + "Must be supplied with the solvability option.") + ("streamliners", "applies any relevant streamliners to the search. If the --solvability option is supplied," + " runs the streamliner version of the search first and then if unsuccessful, the full" + " search for each seed.") ("benchmark", "outputs performance statistics for the solver on the " "supplied solitaire game. Must supply " "either 'random', 'benchmark', 'solvability' or list of deals to be " @@ -141,6 +143,7 @@ bool command_line_helper::parse(int argc, const char* argv[]) { for (uint i = 0; i < cores; i++) resume.push_back(i); } + streamliners = (vm.count("streamliners") != 0); benchmark = (vm.count("benchmark") != 0); @@ -278,3 +281,7 @@ string command_line_helper::get_describe_game_rules() { bool command_line_helper::get_benchmark() { return benchmark; } + +bool command_line_helper::get_streamliners() { + return streamliners; +} -- cgit v1.2.1