diff options
| author | Charlie Blake | 2018-07-25 15:00:18 +0100 |
|---|---|---|
| committer | Charlie Blake | 2018-07-26 10:32:38 +0100 |
| commit | 0c5edfac929ae8e68090af1ef5a4031e9f02f2c2 (patch) | |
| tree | 79249838d3e5f30869591dce33f74b096617d50f /src/main/evaluation | |
| parent | Add timeout to individual games (diff) | |
| download | metasol-0c5edfac929ae8e68090af1ef5a4031e9f02f2c2.tar.gz metasol-0c5edfac929ae8e68090af1ef5a4031e9f02f2c2.zip | |
Add csv output to single deal and init sol script
Diffstat (limited to 'src/main/evaluation')
| -rw-r--r-- | src/main/evaluation/solvability_calc.cpp | 63 | ||||
| -rw-r--r-- | src/main/evaluation/solvability_calc.h | 2 |
2 files changed, 4 insertions, 61 deletions
diff --git a/src/main/evaluation/solvability_calc.cpp b/src/main/evaluation/solvability_calc.cpp index c981644..85a8f34 100644 --- a/src/main/evaluation/solvability_calc.cpp +++ b/src/main/evaluation/solvability_calc.cpp @@ -29,47 +29,6 @@ solvability_calc::solvability_calc(const sol_rules& r, uint64_t cache_capacity_) // PRINTING METHODS // ////////////////////// -void solvability_calc::print_header(long t) const { - cout << "Calculating solvability percentage...\n\n" - "Lower Bound" - ", Upper Bound" - ", Solvable" - ", Unsolvable" - ", Timed-out" - ", Memory Limited, "; - if (stream_opt == cmd_sos::SMART) { - cout << "| (Streamliner Results:) " - "Attempted Seed" - ", Outcome" - ", Time Taken(ms)" - ", States Searched" - ", Unique States Searched" - ", Backtracks" - ", Dominance Moves" - ", States Removed From Cache" - ", Final States In Cache" - ", Final Buckets In Cache" - ", Maximum Search Depth" - ", Final Search Depth" - "| (Non-Streamliner Results:) "; - } - cout << "Attempted Seed" - ", Outcome" - ", Time Taken(ms)" - ", States Searched" - ", Unique States Searched" - ", Backtracks" - ", Dominance Moves" - ", States Removed From Cache" - ", Final States In Cache" - ", Final Buckets In Cache" - ", Maximum Search Depth" - ", Final Search Depth" - ", Seeds In Progress ..." - "\n--- Timeout = " << t << " milliseconds ---\n"; - cout << fixed << setprecision(3); -} - void solvability_calc::print_general_info(const seed_results& seed_res) { pair<double, double> interval = binomial_ci::wilson( seed_res.solvable, @@ -88,22 +47,8 @@ void solvability_calc::print_seed_info(seed_result seed_res) { int seed = seed_res.first; auto& res = seed_res.second; - cout << ", " << seed - << ", " << res.sol_type - << ", " << res.time.count() - << ", " << res.states_searched - << ", " << res.unique_states_searched - << ", " << res.backtracks - << ", " << res.dominance_moves - << ", " << res.states_removed_from_cache - << ", " << res.cache_size - << ", " << res.cache_bucket_count - << ", " << res.max_depth - << ", " << res.depth; -} - -void solvability_calc::print_null_seed_info() { - cout << ", , , , , , , , , , , , "; + cout << ", " << seed; + solver::print_result_csv(res); } void solvability_calc::print_seeds_in_prog(std::set<int>& seeds_in_progress) { @@ -135,7 +80,7 @@ void solvability_calc::calculate_solvability_percentage(uint64_t timeout_, int s seed_res.timed_out = resume[2]; timeout = millisec(timeout_); - print_header(timeout.count()); + solver::print_header(timeout.count(), stream_opt_); seed_count = seed_count_; stream_opt = stream_opt_; @@ -186,7 +131,7 @@ void solvability_calc::solver_thread(solvability_calc* sc, uint core) { if (sc->stream_opt == cmd_sos::SMART) { print_seed_info(*stream_res); if (no_stream_res) print_seed_info(*no_stream_res); - else print_null_seed_info(); + else solver::print_null_seed_info(); } else { print_seed_info(*no_stream_res); } diff --git a/src/main/evaluation/solvability_calc.h b/src/main/evaluation/solvability_calc.h index cbc3394..25eb844 100644 --- a/src/main/evaluation/solvability_calc.h +++ b/src/main/evaluation/solvability_calc.h @@ -34,10 +34,8 @@ private: }; // Printing methods - void print_header(long) const; static void print_general_info(const seed_results&); static void print_seed_info(seed_result); - static void print_null_seed_info(); static void print_seeds_in_prog(std::set<int>&); // Solving methods |
