From ff60645a940b9c6fddbda7acbea605cc990d8331 Mon Sep 17 00:00:00 2001 From: Charlie Blake Date: Wed, 8 Aug 2018 16:50:29 +0100 Subject: Change output of results to uint64_t data types --- src/main/solver/solver.h | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'src/main') diff --git a/src/main/solver/solver.h b/src/main/solver/solver.h index b4cd105..6b5704e 100644 --- a/src/main/solver/solver.h +++ b/src/main/solver/solver.h @@ -29,15 +29,15 @@ public: enum class type { TIMEOUT, SOLVED, UNSOLVABLE, MEM_LIMIT }; type sol_type; - int states_searched; - int unique_states_searched; - int backtracks; - int dominance_moves; + uint64_t states_searched; + uint64_t unique_states_searched; + uint64_t backtracks; + uint64_t dominance_moves; uint64_t states_removed_from_cache; lru_cache::item_list::size_type cache_size; lru_cache::item_list::size_type cache_bucket_count; - int max_depth; - int depth; + uint64_t max_depth; + uint64_t depth; std::chrono::milliseconds time; }; -- cgit v1.2.1 From 5613822035a28bd95dbe9b0ef3f2076c45f86df6 Mon Sep 17 00:00:00 2001 From: Charlie Blake Date: Wed, 8 Aug 2018 17:02:13 +0100 Subject: Only log cache full error when in debug mode --- src/main/game/global_cache.cpp | 2 ++ 1 file changed, 2 insertions(+) (limited to 'src/main') diff --git a/src/main/game/global_cache.cpp b/src/main/game/global_cache.cpp index 90d962d..f1cf185 100644 --- a/src/main/game/global_cache.cpp +++ b/src/main/game/global_cache.cpp @@ -217,7 +217,9 @@ pair lru_cache::insert(const game_state& gs) { cache.relocate(cache.begin(), prev(cache.end())); if (i == max_num_items) { +#ifndef NDEBUG LOG_ERROR("All items in cache are live and cache is full"); +#endif throw runtime_error("All items in cache are live and cache is full"); } } -- cgit v1.2.1 From 201397b7b74d990699055bc0ccdc373e213ea741 Mon Sep 17 00:00:00 2001 From: Charlie Blake Date: Wed, 8 Aug 2018 17:09:34 +0100 Subject: Print seed ofter runing solver --- src/main/main.cpp | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'src/main') diff --git a/src/main/main.cpp b/src/main/main.cpp index 073cabd..ff03669 100644 --- a/src/main/main.cpp +++ b/src/main/main.cpp @@ -97,9 +97,7 @@ const optional gen_rules(command_line_helper& clh) { } void solve_random_game(int seed, const sol_rules& rules, command_line_helper& clh) { - if (clh.get_classify()) - cout << seed; - else + if (!clh.get_classify()) LOG_INFO ("Attempting to solve with seed: " << seed << "..."); solve_game(rules, clh, seed, none); } @@ -145,6 +143,7 @@ void solve_game(const sol_rules& rules, command_line_helper& clh, optional : optional(); if (clh.get_classify()) { + if (seed) cout << *seed; solver::print_result_csv(solution.second); if (smart) { if (run_again) { -- cgit v1.2.1