aboutsummaryrefslogtreecommitdiff
path: root/src/main/solver
diff options
context:
space:
mode:
authorCharlie Blake2018-07-06 11:14:04 +0100
committerCharlie Blake2018-07-06 11:14:04 +0100
commitb044ca495c6214250628fc984863eb45c5d60852 (patch)
tree5e83e80530232b518904c8980dab2979e7fec87e /src/main/solver
parentFix unit test compile bug (diff)
downloadmetasol-b044ca495c6214250628fc984863eb45c5d60852.tar.gz
metasol-b044ca495c6214250628fc984863eb45c5d60852.zip

Refactored game rules JSON

Diffstat (limited to 'src/main/solver')
-rw-r--r--src/main/solver/solver.cpp12
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