From fb3e96a333cc9b27529f5d2c7866a2f7c4d43ec2 Mon Sep 17 00:00:00 2001 From: Charlie Blake Date: Wed, 13 Jun 2018 15:08:11 +0100 Subject: Add cache capacity command line option --- src/main/input-output/input/command_line_helper.cpp | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) (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 4b0942a..1013f50 100644 --- a/src/main/input-output/input/command_line_helper.cpp +++ b/src/main/input-output/input/command_line_helper.cpp @@ -37,7 +37,9 @@ command_line_helper::command_line_helper() "deal based on a seed. Must supply either 'random'," "'solvability', 'benchmark' or list of deals to be solved.") ("classify", "outputs a simple 'solvable/not solvable' " - "classification") + "classification") + ("cache-capacity", po::value(), "sets an upper bound on the number of states allowed in " + "the cache") ("solvability", "calculates the solvability " "percentage of the supplied solitaire game. Must supply " "either 'random', 'benchmark', 'solvability' or list of deals to be " @@ -102,6 +104,12 @@ bool command_line_helper::parse(int argc, const char* argv[]) { random_deal = -1; } + if (vm.count("cache-capacity")) { + cache_capacity = vm["cache-capacity"].as(); + } else { + cache_capacity = 1000000000; // One billion + } + solvability = (vm.count("solvability") != 0); benchmark = (vm.count("benchmark") != 0); @@ -199,6 +207,10 @@ bool command_line_helper::get_classify() { return classify; } +uint64_t command_line_helper::get_cache_capacity() { + return cache_capacity; +} + bool command_line_helper::get_solvability() { return solvability; } -- cgit v1.2.1 From 5fb3c77b586d7c0e663b178170599a9500efe394 Mon Sep 17 00:00:00 2001 From: Charlie Blake Date: Wed, 13 Jun 2018 15:37:19 +0100 Subject: Add default cache capacity of 100,000,000 --- src/main/input-output/input/command_line_helper.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (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 1013f50..e88f434 100644 --- a/src/main/input-output/input/command_line_helper.cpp +++ b/src/main/input-output/input/command_line_helper.cpp @@ -107,7 +107,7 @@ bool command_line_helper::parse(int argc, const char* argv[]) { if (vm.count("cache-capacity")) { cache_capacity = vm["cache-capacity"].as(); } else { - cache_capacity = 1000000000; // One billion + cache_capacity = 100000000; // One hundred-million } solvability = (vm.count("solvability") != 0); -- cgit v1.2.1