Files
msproj/test/net/woodyfolsom/msproj/GameBoardTest.java
Woody Folsom aca8320600 First working implementation of ANN which is trained using GameResults.
The PassFilter simply outputs BlackWins and WhiteWins (Range 0 - 1 but not presently clamped).
In principle, this type of feedforward ANN can be used to decide whether a PASS will result in blackwins or whitewins at any stage.
The goal is for the network to learn that passing while losing when valid moves exist is bad, but passing while winning is relatively harmless later in the game.
2012-11-17 18:40:31 -05:00

29 lines
1000 B
Java

package net.woodyfolsom.msproj;
import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertTrue;
import org.junit.Test;
public class GameBoardTest {
@Test
public void testCapture() {
GameConfig gameConfig = new GameConfig(5);
GameState gameState = new GameState(gameConfig);
assertTrue(gameState.placeStone(Player.BLACK, Action.getInstance("A2")));
assertTrue(gameState.placeStone(Player.BLACK, Action.getInstance("B3")));
assertTrue(gameState.placeStone(Player.BLACK, Action.getInstance("B1")));
assertTrue(gameState.placeStone(Player.BLACK, Action.getInstance("C2")));
assertTrue(gameState.isSelfFill(Action.getInstance("B2"), Player.BLACK));
assertFalse(gameState
.isSelfFill(Action.getInstance("B2"), Player.WHITE));
assertFalse(gameState
.isSelfFill(Action.getInstance("B4"), Player.BLACK));
assertFalse(gameState
.isSelfFill(Action.getInstance("B4"), Player.BLACK));
System.out.println(gameState);
}
}