aboutsummaryrefslogtreecommitdiff
path: root/src/main/input-output
diff options
context:
space:
mode:
authorCharlie Blake2018-06-20 17:37:22 +0100
committerCharlie Blake2018-06-21 09:57:44 +0100
commitabae8e0529cf2e6048e9b2eb8248434e1f9551de (patch)
treea14ec5c1ec201fd1dc63f6d751ccc2a87b68612d /src/main/input-output
parentSwitch to wilson interval (diff)
downloadmetasol-abae8e0529cf2e6048e9b2eb8248434e1f9551de.tar.gz
metasol-abae8e0529cf2e6048e9b2eb8248434e1f9551de.zip

Add streamliner command line option (inc for spgs)

Diffstat (limited to 'src/main/input-output')
-rw-r--r--src/main/input-output/input/command_line_helper.cpp15
-rw-r--r--src/main/input-output/input/command_line_helper.h2
2 files changed, 13 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 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<int>(), "sets an upper bound on the number of states allowed in "
+ ("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 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<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 "
@@ -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;
+}
diff --git a/src/main/input-output/input/command_line_helper.h b/src/main/input-output/input/command_line_helper.h
index 744935f..c12bb69 100644
--- a/src/main/input-output/input/command_line_helper.h
+++ b/src/main/input-output/input/command_line_helper.h
@@ -21,6 +21,7 @@ public:
uint get_cores();
bool get_available_game_types();
bool get_benchmark();
+ bool get_streamliners();
std::vector<int> get_resume();
uint64_t get_cache_capacity();
std::string get_describe_game_rules();
@@ -51,6 +52,7 @@ private:
uint cores;
bool available_game_types;
bool benchmark;
+ bool streamliners;
uint64_t cache_capacity;
uint64_t timeout;
};