aboutsummaryrefslogtreecommitdiff
path: root/src/main/main.cpp
diff options
context:
space:
mode:
authorCharlie Blake2018-07-25 17:39:27 +0100
committerCharlie Blake2018-07-26 10:33:42 +0100
commit3a95f6d9a3be80795c095256b47c51be241df87e (patch)
tree86d3b0eb65395404f0e9e252b7b5384aed8cba2e /src/main/main.cpp
parentAdd correct solvability script output (diff)
downloadmetasol-3a95f6d9a3be80795c095256b47c51be241df87e.tar.gz
metasol-3a95f6d9a3be80795c095256b47c51be241df87e.zip

Update gen results script to work with changes

Diffstat (limited to 'src/main/main.cpp')
-rw-r--r--src/main/main.cpp25
1 files changed, 24 insertions, 1 deletions
diff --git a/src/main/main.cpp b/src/main/main.cpp
index 55feedf..57540d6 100644
--- a/src/main/main.cpp
+++ b/src/main/main.cpp
@@ -125,13 +125,36 @@ void solve_input_files(const vector<string> input_files, const sol_rules& rules,
void solve_game(const game_state& gs, command_line_helper& clh, int seed) {
solver solv(gs, clh.get_cache_capacity());
- solver::result result = solv.run(millisec(clh.get_timeout()));
+ solver::result result, streamliner_result;
+ bool smart = clh.get_streamliners() == command_line_helper::streamliner_opt::SMART;
+ bool run_again = false;
+
+ if (smart) {
+ result = solv.run(millisec(clh.get_timeout() / 10));
+ run_again = result.sol_type != solver::result::type::SOLVED;
+ if (run_again)
+ streamliner_result = solv.run(millisec(clh.get_timeout()));
+ } else {
+ result = solv.run(millisec(clh.get_timeout()));
+ }
if (clh.get_classify()) {
cout << seed;
solver::print_result_csv(result);
+ if (smart) {
+ if (run_again) {
+ solver::print_result_csv(streamliner_result);
+ } else {
+ solver::print_null_seed_info();
+ }
+ }
cout << "\n";
} else {
+ if (run_again) {
+ cout << "Unsolvable using streamliner. Running again...\n";
+ result = streamliner_result;
+ }
+
if (result.sol_type == solver::result::type::SOLVED) {
solv.print_solution();
} else {