diff options
Diffstat (limited to 'src/main/input-output/input')
| -rw-r--r-- | src/main/input-output/input/command_line_helper.cpp | 26 | ||||
| -rw-r--r-- | src/main/input-output/input/command_line_helper.h | 4 |
2 files changed, 26 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; +} diff --git a/src/main/input-output/input/command_line_helper.h b/src/main/input-output/input/command_line_helper.h index 3ce239d..c12bb69 100644 --- a/src/main/input-output/input/command_line_helper.h +++ b/src/main/input-output/input/command_line_helper.h @@ -21,9 +21,11 @@ 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(); + uint64_t get_timeout(); private: bool assess_errors(); @@ -50,7 +52,9 @@ private: uint cores; bool available_game_types; bool benchmark; + bool streamliners; uint64_t cache_capacity; + uint64_t timeout; }; #endif //SOLVITAIRE_COMMAND_LINE_HELPER_H |
