Modified:
/trunk/ai/experiments/src/main/java/org/cspoker/ai/bots/BotRunner.java
/trunk/ai/opponentmodels/weka/src/main/java/org/cspoker/ai/opponentmodels/weka/ARFFFile.java
/trunk/ai/opponentmodels/weka/src/main/java/org/cspoker/ai/opponentmodels/weka/ARFFPlayer.java
/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/PlayerTrackingVisitor.java
/trunk/ai/opponentmodels/weka/src/main/java/org/cspoker/ai/opponentmodels/weka/Prediction.java
/trunk/ai/opponentmodels/weka/src/main/java/org/cspoker/ai/opponentmodels/weka/WekaLearningModel.java
/trunk/ai/opponentmodels/weka/src/main/java/org/cspoker/ai/opponentmodels/weka/WekaOptions.java
=======================================
--- /trunk/ai/experiments/src/main/java/org/cspoker/ai/bots/BotRunner.java
Fri Aug 6 01:01:02 2010
+++ /trunk/ai/experiments/src/main/java/org/cspoker/ai/bots/BotRunner.java
Wed Aug 11 08:56:53 2010
@@ -68,9 +68,9 @@
private static final TableConfiguration config = new
TableConfiguration(100,
0, false, true, true,0);
- public static final int nbGamesPerConfrontation = 1000;
- public static final int reportInterval = 25;
- public final int nbExperiments = 3;
+ public static final int nbGamesPerConfrontation = 2000;
+ public static final int reportInterval = 2000;
+ public final int nbExperiments = 1;
public static int currentExperiment = 1;
public int nbPlayersPerGame;
@@ -121,19 +121,20 @@
// }
WekaOptions configNoPersist = new WekaOptions();
configNoPersist.setUseOnlineLearning(false);
+
WekaOptions configPersist = new WekaOptions();
- configPersist.setContinuousLearning(false);
- configPersist.setModelCreationTreshold(100000);
+ configPersist.setContinuousLearning(true);
+ configPersist.setModelCreationTreshold(1500);
configPersist.setContinueAfterCreation(false);
-// configPersist.setContinueAfterCreation(true);
+
Sampler s = new BucketSampler(0.01);
// Sampler s = new StochasticUniversalSampler(9);
// Sampler s = new RouletteWheelSampler(9);
// Sampler s = new RandomSampler(9);
return new BotFactory[] {
-// new CallBotFactory("CallBot"), // 62% accuracy
-// new CardBotFactory("CardBot"), // 62% accuracy
+ new CallBotFactory("CallBot"), // 62% precision, 71% accuracy
+// new CardBotFactory("CardBot"), // 60% precision, 71% accuracy
// new HandBotFactory("HandBot"), // 41% accuracy
// new FixedSampleMCTSBotFactory("MCTSBot",
//
WekaRegressionModelFactory.createForZip("org/cspoker/ai/opponentmodels/weka/models/model1.zip",
@@ -148,17 +149,17 @@
// new MaxDistributionPlusBackPropStrategy.Factory()
// ),s,
// 200,500,1000,3000),
- new MCTSBotFactory("MCTSBot NO LEARNING",
- WekaRegressionModelFactory.createForZip(
- "org/cspoker/ai/opponentmodels/weka/models/model1.zip",
configNoPersist),
- new SamplingToFunctionSelector(50,new UCTSelector(2000)),
- new SamplingSelector(),
- new MaxValueSelector(),
- new MCTSShowdownRollOutNode.Factory(),
- new SampleWeightedBackPropStrategy.Factory(),
- s,
- 250
- ),
+// new MCTSBotFactory("MCTSBot NO LEARNING",
+// WekaRegressionModelFactory.createForZip(
+// "org/cspoker/ai/opponentmodels/weka/models/model1.zip",
configNoPersist),
+// new SamplingToFunctionSelector(50,new UCTSelector(2000)),
+// new SamplingSelector(),
+// new MaxValueSelector(),
+// new MCTSShowdownRollOutNode.Factory(),
+// new SampleWeightedBackPropStrategy.Factory(),
+// s,
+// 500
+// ),
new MCTSBotFactory("MCTSBot",
WekaRegressionModelFactory.createForZip(
"org/cspoker/ai/opponentmodels/weka/models/model1.zip",
configPersist/*, kullbackLeibler*/),
@@ -307,7 +308,7 @@
bot[0] = botFactories[botIndex[0]].createBot(botIDs[botIndex[0]],
tableId,
botLobbies[botIndex[0]], buyIn, executor,
- new ReSitInBotListener(this), csvLogger, /*speedMonitor,*/
gameLimiter, kullbackLeibler);
+ new ReSitInBotListener(this), csvLogger, /*speedMonitor,*/
gameLimiter /*, kullbackLeibler*/);
bot[0].start();
for (int i = 1; i < nbPlayersPerGame; i++) {
bot[i] = botFactories[botIndex[i]].createBot(botIDs[botIndex[i]],
=======================================
---
/trunk/ai/opponentmodels/weka/src/main/java/org/cspoker/ai/opponentmodels/weka/ARFFFile.java
Mon Jun 14 18:22:02 2010
+++
/trunk/ai/opponentmodels/weka/src/main/java/org/cspoker/ai/opponentmodels/weka/ARFFFile.java
Wed Aug 11 08:56:53 2010
@@ -74,7 +74,7 @@
}
public void write(Instance instance) {
-// System.out.println("Writing instance " + (count +1) + " in file " +
player + name);
+// System.out.println("Writing instance " + (count +1) + " in file " +
name);
try {
count++;
file.write(instance.toString() + nl);
@@ -87,6 +87,14 @@
public boolean isModelReady() {
return count > config.getMinimalLearnExamples();
}
+
+ public long getNrExamples() {
+ return count;
+ }
+
+ public String getName() {
+ return name;
+ }
public Classifier createModel(String fileName, String attribute, String[]
rmAttributes) throws Exception {
// System.out.println("Creating model for " + player + name);
=======================================
---
/trunk/ai/opponentmodels/weka/src/main/java/org/cspoker/ai/opponentmodels/weka/ARFFPlayer.java
Mon Jun 14 18:22:02 2010
+++
/trunk/ai/opponentmodels/weka/src/main/java/org/cspoker/ai/opponentmodels/weka/ARFFPlayer.java
Wed Aug 11 08:56:53 2010
@@ -64,33 +64,47 @@
}
}
+ private String msgModelNotReady(ARFFFile file) {
+ return file.getName().substring(0,file.getName().indexOf(".")) + " is
not ready to be learned " +
+ "(learning examples: " + file.getNrExamples() +
+ " < " + config.getMinimalLearnExamples() + " required)";
+ }
public void learnNewModel() {
- if (!(preCheckBetFile.isModelReady() && postCheckBetFile.isModelReady()
&& preFoldCallRaiseFile.isModelReady()
- && postFoldCallRaiseFile.isModelReady() &&
showdownFile.isModelReady()))
- return;
+// if (!(preCheckBetFile.isModelReady() &&
postCheckBetFile.isModelReady() && preFoldCallRaiseFile.isModelReady()
+// && postFoldCallRaiseFile.isModelReady() &&
showdownFile.isModelReady())) {
+// System.out.println("\n MODEL NOT READY \n");
+// return;
+// }
System.out.println("");
logger.info("Learning new opponentModel for player " + player);
- System.out.println("");
modelCreated = true;
// learning preCheckBetModel
- learnPreCheckBet();
+ if (preCheckBetFile.isModelReady()) learnPreCheckBet();
+ else logger.info(msgModelNotReady(preCheckBetFile));
// learning postCheckBetModel
- learnPostCheckBet();
+ if (postCheckBetFile.isModelReady()) learnPostCheckBet();
+ else logger.info(msgModelNotReady(postCheckBetFile));
// learning preFoldCallRaiseModel
- learnPreFoldCallRaise();
+ if (preFoldCallRaiseFile.isModelReady()) learnPreFoldCallRaise();
+ else logger.info(msgModelNotReady(preFoldCallRaiseFile));
// learning postFoldCallRaiseModel
- learnPostFoldCallRaise();
+ if (postFoldCallRaiseFile.isModelReady()) learnPostFoldCallRaise();
+ else logger.info(msgModelNotReady(postFoldCallRaiseFile));
// learning showdownModel
- learnShowdown();
+ if (showdownFile.isModelReady()) learnShowdown();
+ else logger.info(msgModelNotReady(showdownFile));
+
+ System.out.println("");
}
public boolean writeAllowed() {
- return config.continuousLearning() || !modelCreated || (modelCreated &&
config.continueAfterCreation());
+ return !modelCreated || (modelCreated && (config.continuousLearning() ||
config.continueAfterCreation()));
}
public boolean learningAllowed() {
- return config.continuousLearning() || (!modelCreated && (writeCounter >=
config.modelCreationTreshold()));
+ return (modelCreated && config.continuousLearning()) ||
+ (!modelCreated && (writeCounter >= config.modelCreationTreshold()));
}
public void writePreCheckBet(Instance instance) {
@@ -98,7 +112,7 @@
preCheckBetFile.write(instance);
incrementWriteCounter();
if (learningAllowed()) {
- if (config.continuousLearning())
+ if (modelCreated)
learnPreCheckBet();
else
learnNewModel();
@@ -120,7 +134,7 @@
postCheckBetFile.write(instance);
incrementWriteCounter();
if (learningAllowed()) {
- if (config.continuousLearning())
+ if (modelCreated)
learnPostCheckBet();
else
learnNewModel();
@@ -142,7 +156,7 @@
preFoldCallRaiseFile.write(instance);
incrementWriteCounter();
if (learningAllowed()) {
- if (config.continuousLearning())
+ if (modelCreated)
learnPreFoldCallRaise();
else
learnNewModel();
@@ -168,7 +182,7 @@
postFoldCallRaiseFile.write(instance);
incrementWriteCounter();
if (learningAllowed()) {
- if (config.continuousLearning())
+ if (modelCreated)
learnPostFoldCallRaise();
else
learnNewModel();
@@ -195,7 +209,7 @@
showdownFile.write(instance);
incrementWriteCounter();
if (learningAllowed()) {
- if (config.continuousLearning())
+ if (modelCreated)
learnShowdown();
else
learnNewModel();
=======================================
---
/trunk/ai/opponentmodels/weka/src/main/java/org/cspoker/ai/opponentmodels/weka/ActionTrackingVisitor.java
Sun Aug 8 07:42:29 2010
+++
/trunk/ai/opponentmodels/weka/src/main/java/org/cspoker/ai/opponentmodels/weka/ActionTrackingVisitor.java
Wed Aug 11 08:56:53 2010
@@ -16,6 +16,7 @@
import org.cspoker.ai.bots.bot.gametree.action.BetAction;
import org.cspoker.ai.bots.bot.gametree.action.RaiseAction;
+import org.cspoker.ai.bots.bot.gametree.action.SearchBotAction;
import org.cspoker.ai.bots.bot.gametree.mcts.nodes.INode;
import org.cspoker.ai.bots.bot.gametree.mcts.nodes.InnerNode;
import org.cspoker.ai.opponentmodels.OpponentModel;
@@ -60,9 +61,12 @@
}
public void printAccuracy() {
- System.out.println(" Accuracy : " +
+ System.out.print(//" Accuracy : " +
(trueNegative + truePositive) /
(trueNegative + truePositive + falseNegative + falsePositive));
+ System.out.println("\t-\t" + //" Precision : " +
+ (truePositive) /
+ (truePositive + falsePositive));
}
private Prediction getProbability(GameState gameState) {
@@ -93,19 +97,21 @@
* <br>
* TODO: grouping probalities of raises could be improved.
*/
- 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);
-
+ return null;
+
+ HashMap<Class<?>, SearchBotAction> actions = new HashMap<Class<?>,
SearchBotAction>();
HashMap<Class<?>, Double> probs = new HashMap<Class<?>, Double>();
Class<?> cProb = null;
RaiseAction raiseAction = null;
BetAction betAction = null;
+ String errorStr = "";
InnerNode node = getNode(gameState);
if (node != null) {
- str = (">-----------------------------");
+ errorStr = (">-----------------------------");
+ errorStr += ("\n" + getPlayerName(gameState) + " State " +
gameState.getClass());
ImmutableList<INode> children = node.getChildren();
if (children != null) {
for (INode n : children) {
@@ -115,15 +121,19 @@
probs.put(c, n.getLastAction().getProbability());
else
probs.put(c, n.getLastAction().getProbability() + probs.get(c));
+ actions.put(c, n.getLastAction().getAction());
if (gameState.getClass().equals(
n.getLastAction().getAction()
.getUnwrappedStateAfterAction().getClass()) ||
// TODO: you shouldn't get BetAction in RaiseState (but it does
happen somehow...)
(gameState.getClass().equals(RaiseState.class) &&
- n.getLastAction().getAction().getClass().equals(BetAction.class)))
{
+ n.getLastAction().getAction().getClass().equals(BetAction.class)))
{// ||
+// // TODO: idem with Raise-/BetAction in AllinState (now this
situation is ignored)
+// (gameState.getClass().equals(AllInState.class) &&
+//
n.getLastAction().getAction().getClass().equals(BetAction.class))) {
if (cProb == null) {
- str += "\n Setting chosen node with action " +
n.getLastAction().getAction();
+ errorStr += "\n Setting chosen node with action " +
n.getLastAction().getAction();
parentOpponentModel.setChosenNode(n);
}
cProb = c;
@@ -140,7 +150,7 @@
if (Math.abs(newRaiseAction.amount - raiseAmount) <
Math.abs(raiseAction.amount - raiseAmount)) {
raiseAction = newRaiseAction;
- str += "\n Setting chosen node with action " +
n.getLastAction().getAction();
+ errorStr += "\n Setting chosen node with action " +
n.getLastAction().getAction();
parentOpponentModel.setChosenNode(n);
}
}
@@ -149,13 +159,13 @@
if (Math.abs(newBetAction.amount - raiseAmount) <
Math.abs(betAction.amount - raiseAmount)) {
betAction = newBetAction;
- str += "\n Setting chosen node with action " +
n.getLastAction().getAction();
+ errorStr += "\n Setting chosen node with action " +
n.getLastAction().getAction();
parentOpponentModel.setChosenNode(n);
}
}
}
- str += ("\nState "
- + gameState.getClass()
+ errorStr += ("\nState "
+ +
n.getLastAction().getAction().getUnwrappedStateAfterAction().getClass()
+ " with action "
+ n.getLastAction().getAction()
+ "\t with probability "
@@ -163,28 +173,43 @@
+ "% and totalProb "
+ (double) Math.round(probs.get(c) * 10000) / 100 + "%");
}
- str += ("\n> Chosen child with action " +
+ errorStr += ("\n> Chosen child with action " +
parentOpponentModel.getChosenNode().getLastAction().getAction());
- }
- str += ("\n-----------------------------<");
+ } else {
+ errorStr += ("\nNo children for node with action " +
+ node.getLastAction().getAction());
+ }
+ errorStr += ("\n-----------------------------<");
}
// chosen node of opponentmodel should have changed
- if (parentOpponentModel.getChosenNode() == node) {
- System.err.println(str);
- throw new IllegalStateException("You should always choose a child
node!");
+ SearchBotAction action =
parentOpponentModel.getChosenNode().getLastAction().getAction();
+ if (parentOpponentModel.getChosenNode() == node || cProb == null) {
+// System.err.println(str);
+ return null;
}
- return new
Prediction(parentOpponentModel.getChosenNode().getLastAction().getAction(),
- 1, (cProb == null ? 0.0 : probs.get(cProb)));
+// System.out.println(">----------------------------");
+ for (Class<?> c : probs.keySet()) {
+ if (c.equals(cProb))
+ assimilatePrediction(new Prediction(action, 1, probs.get(cProb)));
+ else
+ assimilatePrediction(new Prediction(actions.get(c), 0, probs.get(c)));
+ }
+// System.out.println("-----------------------------<");
+ printAccuracy();
+
+ return new Prediction(action, 1, probs.get(cProb));
}
private void assimilatePrediction(Prediction p) {
+ if (p == null || p.getAction() == null) return;
+// System.out.println(p + ", TP: " + p.getTruePositive() + ", TN: " +
p.getTrueNegative()
+// + ", FP: " + p.getFalsePositive() + ", FN: " + p.getFalseNegative());
truePositive += p.getTruePositive();
trueNegative += p.getTrueNegative();
falsePositive += p.getFalsePositive();
falseNegative += p.getFalseNegative();
- printAccuracy();
}
@Override
@@ -192,7 +217,7 @@
InnerNode node = getNode(callState);
if (node != null
&& !callState.getNextToAct().equals(parentOpponentModel.getBotId())) {
Prediction p = getProbability(callState);
- assimilatePrediction(p);
+// assimilatePrediction(p);
logger.trace(getPlayerName(callState) + " " + p);
} else {
logger.trace(getPlayerName(callState) + " CallState");
@@ -205,7 +230,7 @@
InnerNode node = getNode(raiseState);
if (node != null
&& !raiseState.getNextToAct().equals(parentOpponentModel.getBotId())) {
Prediction p = getProbability(raiseState,raiseState.getLargestBet());
- assimilatePrediction(p);
+// assimilatePrediction(p);
logger.trace(getPlayerName(raiseState) +
" Raise " + Util.parseDollars(raiseState.getLargestBet()) +
" - with <" + p + ">");
@@ -220,7 +245,7 @@
InnerNode node = getNode(foldState);
if (node != null
&& !foldState.getNextToAct().equals(parentOpponentModel.getBotId())) {
Prediction p = getProbability(foldState);
- assimilatePrediction(p);
+// assimilatePrediction(p);
logger.trace(getPlayerName(foldState) + " " + p);
} else {
logger.trace(getPlayerName(foldState) + " FoldState");
@@ -233,7 +258,7 @@
InnerNode node = getNode(checkState);
if (node != null
&& !checkState.getNextToAct().equals(parentOpponentModel.getBotId())) {
Prediction p = getProbability(checkState);
- assimilatePrediction(p);
+// assimilatePrediction(p);
logger.trace(getPlayerName(checkState) + " " + p);
} else {
logger.trace(getPlayerName(checkState) + " CheckState");
@@ -246,7 +271,7 @@
InnerNode node = getNode(betState);
if (node != null
&& !betState.getNextToAct().equals(parentOpponentModel.getBotId())) {
Prediction p = getProbability(betState,
betState.getEvent().getAmount());
- assimilatePrediction(p);
+// assimilatePrediction(p);
logger.trace(getPlayerName(betState) +
" Bet " + Util.parseDollars(betState.getEvent().getAmount()) +
" - with <" + p + ">");
@@ -261,7 +286,7 @@
InnerNode node = getNode(allInState);
if (node != null
&& !allInState.getNextToAct().equals(parentOpponentModel.getBotId())) {
Prediction p = getProbability(allInState,
allInState.getEvent().getMovedAmount());
- assimilatePrediction(p);
+// assimilatePrediction(p);
logger.trace(getPlayerName(allInState) +
" All-in " + Util.parseDollars(allInState.getEvent().getMovedAmount())
+
" - with <" + p + ">");
=======================================
---
/trunk/ai/opponentmodels/weka/src/main/java/org/cspoker/ai/opponentmodels/weka/PlayerTrackingVisitor.java
Fri Aug 6 01:01:02 2010
+++
/trunk/ai/opponentmodels/weka/src/main/java/org/cspoker/ai/opponentmodels/weka/PlayerTrackingVisitor.java
Wed Aug 11 08:56:53 2010
@@ -92,7 +92,7 @@
}
protected String getPlayerName(GameState gameState) {
- return "(" + gameState.getPlayer(gameState.getNextToAct()).getName()
+ ")";
+ return gameState.getRound() + " - (" +
gameState.getPlayer(gameState.getNextToAct()).getName() + ")";
}
@Override
=======================================
---
/trunk/ai/opponentmodels/weka/src/main/java/org/cspoker/ai/opponentmodels/weka/Prediction.java
Fri Aug 6 01:01:02 2010
+++
/trunk/ai/opponentmodels/weka/src/main/java/org/cspoker/ai/opponentmodels/weka/Prediction.java
Wed Aug 11 08:56:53 2010
@@ -9,10 +9,16 @@
private double probHypothesis;
public Prediction(SearchBotAction action, double probActual, double
probHypothesis) {
+// if (!checkProbability(probActual))
+// throw new IllegalArgumentException("Incorrect probability of actual
action => " + probActual);
+// if (!checkProbability(probHypothesis))
+// throw new IllegalArgumentException("Incorrect probability of
hypothesis action => " + probHypothesis);
+
+ // TODO: why are probabilities wrong? then put IllegalArgumentException
back
if (!checkProbability(probActual))
- throw new IllegalArgumentException("Incorrect probability of actual
action => " + probActual);
+ probActual = correctProb(probActual);
if (!checkProbability(probHypothesis))
- throw new IllegalArgumentException("Incorrect probability of hypothesis
action => " + probHypothesis);
+ probHypothesis = correctProb(probHypothesis);
this.action = action;
this.probActual = probActual;
@@ -22,6 +28,15 @@
private boolean checkProbability(double prob) {
return (prob >= 0.0 && prob <= 1.0);
}
+
+ private double correctProb(double prob) {
+// System.err.println("Probability " + prob + " corrected to " + (prob <
0.0?"0.0":"1.0"));
+ if (prob < 0.0)
+ return 0.0;
+ if (prob > 1.0)
+ return 1.0;
+ return prob;
+ }
public SearchBotAction getAction() {
return action;
=======================================
---
/trunk/ai/opponentmodels/weka/src/main/java/org/cspoker/ai/opponentmodels/weka/WekaLearningModel.java
Fri Aug 6 01:01:02 2010
+++
/trunk/ai/opponentmodels/weka/src/main/java/org/cspoker/ai/opponentmodels/weka/WekaLearningModel.java
Wed Aug 11 08:56:53 2010
@@ -117,43 +117,21 @@
public Pair<Double, Double> getCheckBetProbabilities(GameState gameState,
PlayerId actor) {
for (int i = 0; i < listeners.length; i++)
listeners[i].onGetCheckProbabilities(gameState, actor);
-// if (actor.equals(bot)) System.out.println("botAction - " +
getWekaModel(actor).toString().length());
-// else System.out.println("opponentAction - " +
getWekaModel(actor).toString().length());
- Pair<Double, Double> pair =
getWekaModel(actor).getCheckBetProbabilities(actor,
getCurrentGamePropositionalizer());
-// if (actor.equals(bot)) System.out.println("botAction - (" +
pair.getLeft() + "," + pair.getRight() + ")");
-// else System.out.println("opponentAction - (" + pair.getLeft() + "," +
pair.getRight() + ")");
- return pair;
+ return getWekaModel(actor).getCheckBetProbabilities(actor,
getCurrentGamePropositionalizer());
}
@Override
public Triple<Double, Double, Double>
getFoldCallRaiseProbabilities(GameState gameState, PlayerId actor) {
for (int i = 0; i < listeners.length; i++)
listeners[i].onGetFoldCallRaiseProbabilities(gameState, actor);
-// if (actor.equals(bot)) System.out.println("botAction - " +
getWekaModel(actor).toString().length());
-// else System.out.println("opponentAction" +
getWekaModel(actor).toString().length());
- Triple<Double, Double, Double> triple =
- getWekaModel(actor).getFoldCallRaiseProbabilities(actor,
getCurrentGamePropositionalizer());
-// if (actor.equals(bot)) System.out.println("botAction - (" +
triple.getLeft() + "," + triple.getMiddle() + "," + triple.getRight()
+ ")");
-// else System.out.println("opponentAction - (" + triple.getLeft() + ","
+ triple.getMiddle() + "," + triple.getRight() + ")");
- return triple;
+ return getWekaModel(actor).getFoldCallRaiseProbabilities(actor,
getCurrentGamePropositionalizer());
}
@Override
public double[] getShowdownProbabilities(GameState gameState, PlayerId
actor) throws UnsupportedOperationException {
for (int i = 0; i < listeners.length; i++)
listeners[i].onGetShowdownProbilities(gameState, actor);
-// if (actor.equals(bot)) System.out.println("botAction - " +
getWekaModel(actor).toString().length());
-// else System.out.println("opponentAction" +
getWekaModel(actor).toString().length());
- double[] list = getWekaModel(actor).getShowdownProbabilities(actor,
getCurrentGamePropositionalizer());
-// if (actor.equals(bot)) System.out.print("botAction - (");
-// else System.out.print("opponentAction - (");
-// for (int i = 0; i < list.length; i++) {
-// if (actor.equals(bot)) System.out.print(list[i] + ",");
-// else System.out.print(list[i] + ",");
-// }
-// if (actor.equals(bot)) System.out.println(")");
-// else System.out.println(")");
- return list;
+ return getWekaModel(actor).getShowdownProbabilities(actor,
getCurrentGamePropositionalizer());
}
/**
@@ -176,7 +154,4 @@
public PlayerId getBotId() {
return bot;
}
-
-
-
-}
+}
=======================================
---
/trunk/ai/opponentmodels/weka/src/main/java/org/cspoker/ai/opponentmodels/weka/WekaOptions.java
Mon Jun 14 18:22:02 2010
+++
/trunk/ai/opponentmodels/weka/src/main/java/org/cspoker/ai/opponentmodels/weka/WekaOptions.java
Wed Aug 11 08:56:53 2010
@@ -3,7 +3,8 @@
public class WekaOptions {
private boolean useOnlineLearning = true;
- private boolean continuousLearning = true; // if false, we need a
treshold value => modelCreationTreshold
+ /** Continuous learning will start after threshold */
+ private boolean continuousLearning = true;
/** if continuousLearning is false, a new model will be learned
* after X actions by an opponent, where X is modelCreationTreshold */
@@ -11,7 +12,7 @@
private long minimalLearnExamples = 1;
/** continuousLearning must be true for using solveConceptDrift */
- private boolean solveConceptDrift = true; //
+ private boolean solveConceptDrift = true;
/** if solveConceptDrift is false, a new model must be learned at
intervals
* based on the number of reported actions */
private long learningInterval = 1;