[cspoker] r1386 committed - Fixed major bug in ActionTrackingVisitor

1 view
Skip to first unread message

codesite...@google.com

unread,
Aug 8, 2010, 10:43:44 AM8/8/10
to cspoker...@googlegroups.com
Revision: 1386
Author: laurent.verbruggen
Date: Sun Aug 8 07:42:29 2010
Log: Fixed major bug in ActionTrackingVisitor
http://code.google.com/p/cspoker/source/detail?r=1386

Modified:

/trunk/ai/opponentmodels/weka/src/main/java/org/cspoker/ai/opponentmodels/weka/ActionTrackingVisitor.java

=======================================
---
/trunk/ai/opponentmodels/weka/src/main/java/org/cspoker/ai/opponentmodels/weka/ActionTrackingVisitor.java
Sun Aug 8 07:25:37 2010
+++
/trunk/ai/opponentmodels/weka/src/main/java/org/cspoker/ai/opponentmodels/weka/ActionTrackingVisitor.java
Sun Aug 8 07:42:29 2010
@@ -51,11 +51,7 @@
return (ARFFPropositionalizer) this.propz;
}

- private InnerNode getNode(GameState state) {
- // This method is only called after MCTSBot has acted
- if (parentOpponentModel.getChosenNode() == null)
- throw new IllegalStateException("MCTSBot hasn't acted yet!");
-
+ private InnerNode getNode(GameState state) {
try {
return (InnerNode) parentOpponentModel.getChosenNode();
} catch (ClassCastException e) {
@@ -99,6 +95,10 @@
*/
private String str = "";
private Prediction getProbability(GameState gameState, double
raiseAmount) {
+ // This method should only be called after MCTSBot has acted
+ if (parentOpponentModel.getChosenNode() == null)
+ return new Prediction(null, 1, 0);
+
HashMap<Class<?>, Double> probs = new HashMap<Class<?>, Double>();
Class<?> cProb = null;
RaiseAction raiseAction = null;
@@ -172,7 +172,7 @@
// chosen node of opponentmodel should have changed
if (parentOpponentModel.getChosenNode() == node) {
System.err.println(str);
- throw new IllegalStateException("You should always chose a child
node!");
+ throw new IllegalStateException("You should always choose a child
node!");
}

return new
Prediction(parentOpponentModel.getChosenNode().getLastAction().getAction(),

Reply all
Reply to author
Forward
0 new messages