diff options
| author | Charlie Blake | 2018-04-07 14:51:17 +0100 |
|---|---|---|
| committer | GitHub | 2018-04-07 14:51:17 +0100 |
| commit | 94fb68b51562a2051448f2a82f3df4eb3ff80078 (patch) | |
| tree | fa4a23f5c2c28e09b90870fd74384067d2d3fba5 /src/main/evaluation | |
| parent | Merge pull request #54 from thecharlesblake/fix-built-group-bug (diff) | |
| parent | Add tuned optimisation eval games (diff) | |
| download | metasol-94fb68b51562a2051448f2a82f3df4eb3ff80078.tar.gz metasol-94fb68b51562a2051448f2a82f3df4eb3ff80078.zip | |
Merge pull request #55 from thecharlesblake/optimisation-eval
Add tuned optimisation eval games
Diffstat (limited to 'src/main/evaluation')
| -rw-r--r-- | src/main/evaluation/benchmark.cpp | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/src/main/evaluation/benchmark.cpp b/src/main/evaluation/benchmark.cpp index 79e2edc..74d34a3 100644 --- a/src/main/evaluation/benchmark.cpp +++ b/src/main/evaluation/benchmark.cpp @@ -10,14 +10,14 @@ #include "../solver/solver.h" using namespace std; -typedef chrono::milliseconds millisec; +typedef chrono::microseconds microsec; void benchmark::run(const sol_rules &rules) { cout << "Seed " - "| Median Solution Time(ms) " + "| Median Solution Time(μs) " "| Median States Searched " - "| Median (Non-Zero) Solution Depth " "| Median Backtracks " + "| Median (Non-Zero) Solution Depth " "| Solvable/Unsolvable "; multiset<int> sol_times; @@ -34,10 +34,10 @@ void benchmark::run(const sol_rules &rules) { auto start = chrono::steady_clock::now(); solver::sol_state result = sol.run(); auto end = chrono::steady_clock::now(); - millisec elapsed_millis = - chrono::duration_cast<chrono::milliseconds>(end - start); + microsec elapsed_micros = + chrono::duration_cast<chrono::microseconds>(end - start); - sol_times.insert(static_cast<int>(elapsed_millis.count())); + sol_times.insert(static_cast<int>(elapsed_micros.count())); states_searched.insert(sol.get_states_searched()); if (sol.get_final_depth() != 0) sol_depths.insert(sol.get_final_depth()); backtracks.insert(sol.get_backtrack_count()); @@ -56,8 +56,8 @@ void benchmark::run(const sol_rules &rules) { cout << "\n" << seed << " | " << *next(begin(sol_times), (sol_times.size())/2) << " | " << *next(begin(states_searched), (states_searched.size())/2) - << " | " << *next(begin(sol_depths), (sol_depths.size())/2) << " | " << *next(begin(backtracks), (backtracks.size())/2) + << " | " << *next(begin(sol_depths), (sol_depths.size())/2) << " | " << total_solvable << "/" << total_unsolvable; } |
