aboutsummaryrefslogtreecommitdiff
path: root/src/main/input-output/input/command_line_helper.cpp
diff options
context:
space:
mode:
authorCharlie Blake2018-06-21 15:13:19 +0100
committerGitHub2018-06-21 15:13:19 +0100
commit4c617d49ce2fc162f25379df7715de34c0bbc349 (patch)
tree49d507a2024cdbbf68be95719ff60d4fee04fc99 /src/main/input-output/input/command_line_helper.cpp
parentMerge pull request #64 from thecharlesblake/solvability-csv-output (diff)
parentFixup randomness (diff)
downloadmetasol-4c617d49ce2fc162f25379df7715de34c0bbc349.tar.gz
metasol-4c617d49ce2fc162f25379df7715de34c0bbc349.zip

Merge pull request #65 from thecharlesblake/solvability-improvements

Solvability improvements

Diffstat (limited to 'src/main/input-output/input/command_line_helper.cpp')
-rw-r--r--src/main/input-output/input/command_line_helper.cpp26
1 files changed, 22 insertions, 4 deletions
diff --git a/src/main/input-output/input/command_line_helper.cpp b/src/main/input-output/input/command_line_helper.cpp
index 2abef54..ec9a375 100644
--- a/src/main/input-output/input/command_line_helper.cpp
+++ b/src/main/input-output/input/command_line_helper.cpp
@@ -41,14 +41,17 @@ command_line_helper::command_line_helper()
("cache-capacity", po::value<uint64_t>(), "sets an upper bound on the number of states allowed in "
"the cache")
("solvability", po::value<int>(), "calculates the solvability "
- "percentage of the supplied solitaire game, given a timeout in milliseconds. Must supply "
- "either 'random', 'benchmark', 'solvability' or list of deals to be "
- "solved.")
+ "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<uint64_t>(), "adds a per-game timeout to the solvability percentage generation")
("resume", po::value<vector<int>>()->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<uint>(), "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 "
@@ -121,6 +124,12 @@ bool command_line_helper::parse(int argc, const char* argv[]) {
solvability = -1;
}
+ if (vm.count("timeout")) {
+ timeout = vm["timeout"].as<uint64_t>();
+ } else {
+ timeout = 604800000; // 1 week in milliseconds
+ }
+
if (vm.count("cores")) {
cores = vm["cores"].as<uint>();
} else {
@@ -134,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);
@@ -248,6 +258,10 @@ int command_line_helper::get_solvability() {
return solvability;
}
+uint64_t command_line_helper::get_timeout() {
+ return timeout;
+}
+
vector<int> command_line_helper::get_resume() {
return resume;
}
@@ -267,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;
+}