Code cleanup; Initial implementation of root parallelization.
This commit is contained in:
@@ -14,8 +14,11 @@ public class AlphaBetaTest {
|
||||
Policy treeSearch = new AlphaBeta();
|
||||
GameConfig gameConfig = new GameConfig(6);
|
||||
GameState gameState = new GameState(gameConfig);
|
||||
gameState.playStone(Player.BLACK, Action.getInstance("PASS"));
|
||||
gameState.playStone(Player.WHITE, Action.getInstance("A2"));
|
||||
gameState.playStone(Player.BLACK, Action.getInstance("PASS"));
|
||||
gameState.playStone(Player.WHITE, Action.getInstance("B1"));
|
||||
gameState.playStone(Player.BLACK, Action.getInstance("PASS"));
|
||||
gameState.playStone(Player.WHITE, Action.getInstance("C2"));
|
||||
gameState.playStone(Player.BLACK, Action.getInstance("B2"));
|
||||
|
||||
@@ -38,7 +41,9 @@ public class AlphaBetaTest {
|
||||
GameConfig gameConfig = new GameConfig(6);
|
||||
GameState gameState = new GameState(gameConfig);
|
||||
gameState.playStone(Player.BLACK, Action.getInstance("A2"));
|
||||
gameState.playStone(Player.WHITE, Action.getInstance("PASS"));
|
||||
gameState.playStone(Player.BLACK, Action.getInstance("B1"));
|
||||
gameState.playStone(Player.WHITE, Action.getInstance("PASS"));
|
||||
gameState.playStone(Player.BLACK, Action.getInstance("C2"));
|
||||
gameState.playStone(Player.WHITE, Action.getInstance("B2"));
|
||||
|
||||
|
||||
@@ -17,8 +17,11 @@ public class MonteCarloUCTTest {
|
||||
Policy treeSearch = new MonteCarloUCT(new RandomMovePolicy(),10000L);
|
||||
GameConfig gameConfig = new GameConfig(6);
|
||||
GameState gameState = new GameState(gameConfig);
|
||||
gameState.playStone(Player.BLACK, Action.getInstance("PASS"));
|
||||
gameState.playStone(Player.WHITE, Action.getInstance("A2"));
|
||||
gameState.playStone(Player.BLACK, Action.getInstance("PASS"));
|
||||
gameState.playStone(Player.WHITE, Action.getInstance("B1"));
|
||||
gameState.playStone(Player.BLACK, Action.getInstance("PASS"));
|
||||
gameState.playStone(Player.WHITE, Action.getInstance("C2"));
|
||||
gameState.playStone(Player.BLACK, Action.getInstance("B2"));
|
||||
|
||||
|
||||
@@ -3,9 +3,6 @@ package net.woodyfolsom.msproj.sgf;
|
||||
import static org.junit.Assert.assertEquals;
|
||||
|
||||
import java.io.ByteArrayInputStream;
|
||||
import java.io.File;
|
||||
import java.io.FileInputStream;
|
||||
import java.io.FileNotFoundException;
|
||||
import java.io.IOException;
|
||||
|
||||
import org.antlr.runtime.ANTLRInputStream;
|
||||
|
||||
@@ -2,7 +2,6 @@ package net.woodyfolsom.msproj.sgf;
|
||||
|
||||
import java.io.File;
|
||||
import java.io.FileInputStream;
|
||||
import java.io.FileNotFoundException;
|
||||
import java.io.IOException;
|
||||
|
||||
import org.antlr.runtime.ANTLRInputStream;
|
||||
@@ -15,20 +14,21 @@ public class SGFParserTest {
|
||||
|
||||
@Test
|
||||
public void testParse() throws RecognitionException, IOException {
|
||||
FileInputStream fis = new FileInputStream(new File("data/games/1334-gokifu-20120916-Gu_Li-Lee_Sedol.sgf"));
|
||||
ANTLRStringStream in = new ANTLRInputStream(fis);
|
||||
SGFLexer lexer = new SGFLexer(in);
|
||||
CommonTokenStream tokens = new CommonTokenStream(lexer);
|
||||
SGFParser parser = new SGFParser(tokens);
|
||||
SGFNodeCollection nodeCollection = parser.collection();
|
||||
|
||||
System.out.println("To SGF:");
|
||||
System.out.println(nodeCollection.toSGF());
|
||||
System.out.println("");
|
||||
|
||||
System.out.println("To LaTeX:");
|
||||
System.out.println(nodeCollection.toLateX());
|
||||
System.out.println("");
|
||||
|
||||
FileInputStream fis = new FileInputStream(new File(
|
||||
"data/games/1334-gokifu-20120916-Gu_Li-Lee_Sedol.sgf"));
|
||||
ANTLRStringStream in = new ANTLRInputStream(fis);
|
||||
SGFLexer lexer = new SGFLexer(in);
|
||||
CommonTokenStream tokens = new CommonTokenStream(lexer);
|
||||
SGFParser parser = new SGFParser(tokens);
|
||||
SGFNodeCollection nodeCollection = parser.collection();
|
||||
|
||||
System.out.println("To SGF:");
|
||||
System.out.println(nodeCollection.toSGF());
|
||||
System.out.println("");
|
||||
|
||||
System.out.println("To LaTeX:");
|
||||
System.out.println(nodeCollection.toLateX());
|
||||
System.out.println("");
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user