diff options
| author | Charlie Blake | 2018-06-13 15:38:20 +0100 |
|---|---|---|
| committer | GitHub | 2018-06-13 15:38:20 +0100 |
| commit | ccb1232a48deef855d0e0f3ea0f69382494975cc (patch) | |
| tree | bcc8fe29ea84abbd6682c1a880064a90dd65f959 /src/main/input-output | |
| parent | Merge pull request #59 from thecharlesblake/paper-tidy-up (diff) | |
| parent | Add default cache capacity of 100,000,000 (diff) | |
| download | metasol-ccb1232a48deef855d0e0f3ea0f69382494975cc.tar.gz metasol-ccb1232a48deef855d0e0f3ea0f69382494975cc.zip | |
Merge pull request #60 from thecharlesblake/cache-mem-limit
Cache mem limit
Diffstat (limited to 'src/main/input-output')
| -rw-r--r-- | src/main/input-output/input/command_line_helper.cpp | 14 | ||||
| -rw-r--r-- | src/main/input-output/input/command_line_helper.h | 2 |
2 files changed, 15 insertions, 1 deletions
diff --git a/src/main/input-output/input/command_line_helper.cpp b/src/main/input-output/input/command_line_helper.cpp index 4b0942a..e88f434 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<uint64_t>(), "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<uint64_t>(); + } else { + cache_capacity = 100000000; // One hundred-million + } + 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; } diff --git a/src/main/input-output/input/command_line_helper.h b/src/main/input-output/input/command_line_helper.h index 911cd5a..ca58d5f 100644 --- a/src/main/input-output/input/command_line_helper.h +++ b/src/main/input-output/input/command_line_helper.h @@ -20,6 +20,7 @@ public: bool get_solvability(); bool get_available_game_types(); bool get_benchmark(); + uint64_t get_cache_capacity(); std::string get_describe_game_rules(); private: @@ -44,6 +45,7 @@ private: bool solvability; bool available_game_types; bool benchmark; + uint64_t cache_capacity; }; #endif //SOLVITAIRE_COMMAND_LINE_HELPER_H |
