From 9711281fc45f69fcaf634e6092bba3f3dfad20c0 Mon Sep 17 00:00:00 2001 From: melvin Date: Thu, 16 Jun 2011 17:41:39 +0800 Subject: [PATCH] enabled checkNode --- src/magic/ai/MCTSAI.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/magic/ai/MCTSAI.java b/src/magic/ai/MCTSAI.java index 854ac17c6c..e6bfbf686f 100644 --- a/src/magic/ai/MCTSAI.java +++ b/src/magic/ai/MCTSAI.java @@ -285,8 +285,8 @@ public class MCTSAI implements MagicAI { private boolean checkNode(final MCTSGameTree curr, List choices) { for (MCTSGameTree child : curr) { - final int checksum = obj2StringHash(choices.get(child.getChoice())[0]); - if (child.getChecksum() != checksum) { + final String checkStr = obj2String(choices.get(child.getChoice())[0]); + if (!child.desc.equals(checkStr)) { System.err.println("ERROR! tree node and choice do not match"); printNode(curr, choices); return false; @@ -368,7 +368,7 @@ public class MCTSAI implements MagicAI { //all the children are in the tree, find the "best" child to explore } else { - //assert checkNode(curr, choices); + assert checkNode(curr, choices); assert curr.size() == choices.size() : "ERROR! Different number of choices in node and game" + printNode(curr,choices);