diff options
| author | Charlie Blake | 2018-07-06 17:27:39 +0100 |
|---|---|---|
| committer | GitHub | 2018-07-06 17:27:39 +0100 |
| commit | 0e685d6e4a343daab945f5fb7d0cf250c077b6ff (patch) | |
| tree | 634eede8d39d3e313c1206cb2b9a6f6205570f8c /src/main/solver | |
| parent | Merge pull request #74 from thecharlesblake/sol-streamliner-variants (diff) | |
| parent | Refactor k-plus impl to simplify and fix deal1 bug (diff) | |
| download | metasol-0e685d6e4a343daab945f5fb7d0cf250c077b6ff.tar.gz metasol-0e685d6e4a343daab945f5fb7d0cf250c077b6ff.zip | |
Merge pull request #75 from thecharlesblake/refactor-rules-json
Refactor rules json
Diffstat (limited to 'src/main/solver')
| -rw-r--r-- | src/main/solver/solver.cpp | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/src/main/solver/solver.cpp b/src/main/solver/solver.cpp index e600835..6b0c980 100644 --- a/src/main/solver/solver.cpp +++ b/src/main/solver/solver.cpp @@ -12,6 +12,7 @@ #include "solver.h" #include "../game/move.h" #include "../input-output/output/log_helper.h" +#include "../input-output/output/state_printer.h" using std::atomic; using std::vector; @@ -57,6 +58,7 @@ solver::sol_state solver::run(boost::optional<atomic<bool> &> terminate_solver) if (current_node->mv.type == move::mtype::dominance) { LOG_DEBUG("(dominance move)"); } + state_printer::print_move(clog, current_node->mv); LOG_DEBUG(state); #endif @@ -134,11 +136,19 @@ bool solver::revert_to_last_node_with_children(optional<lru_cache::item_list::it // (as long as the move wasn't a dominance move) if (current_node->mv.type != move::mtype::dominance) { - if (cache.get_states_removed_from_cache() == 0) assert(cache.contains(state)); + if (cache.get_states_removed_from_cache() == 0) { + if (!cache.contains(state)) { + state_printer::print_move(clog, current_node->mv); + LOG_DEBUG("-------"); + LOG_DEBUG(state); + assert(false); + } + } LOG_DEBUG("(undo move)"); } else { LOG_DEBUG("(undo dominance move)"); } + state_printer::print_move(clog, current_node->mv); LOG_DEBUG(state); #endif |
