- I created a ComboPlayer.java agent. It sucks and doesn't really work, but I created it. Now I'm putting it down to work on other things.

This commit is contained in:
Marshall
2012-04-29 20:54:34 -04:00
parent e012f17b33
commit 8de42a3562
13 changed files with 239 additions and 83 deletions

View File

@@ -128,7 +128,8 @@ public class Referee implements Runnable {
int tile = 0;
for (int r = 0; r < Board.NUM_ROWS; r++) {
for (int c = 0; c < Board.NUM_COLS; c++) {
move[tile] = (mv.getCell().r == r && mv.getCell().c == c);
move[tile + 4] = (mv.getCell().r == r && mv.getCell().c == c);
tile++;
}
}
@@ -163,12 +164,13 @@ public class Referee implements Runnable {
System.out
.println("Interrupted while waiting for human to move!");
} else {
getPlayerModel().getOutputNodes(getBoardState(board));
Move mv = humanPlayer.getMove(board, playerModel);
if (board.getTile(mv.getCell().r, mv.getCell().c) == TileColor.NONE) {
playToken(humanPlayer.getMove(board, playerModel));
getPlayerModel().train(getBoardState(board),
getMoveArray(mv));
getPlayerModel().train(getMoveArray(mv));
} else {
humanPlayer.denyMove();
@@ -177,7 +179,7 @@ public class Referee implements Runnable {
} else {
Move mv = computerPlayer.getMove(board, getPlayerModel());
playToken(mv);
// This is the call that gets a prediction of a user's move.
// Some changes will probably be necessary to put it in the
// right place and also to get the node weights. But... all in