Substantial refactoring to implement correct Naive, UCT Monte Carlo tree search methods.
Removed unnecessary distinction between policy and tree search (tree search is a special kind of policy). Calculation of all valid moves / arbitrary sets of moves is now a seperate class, as it serves a different purpose than a policy. Introduced regression error in AlphaBeta test.
This commit is contained in:
28
test/net/woodyfolsom/msproj/GameScoreTest.java
Normal file
28
test/net/woodyfolsom/msproj/GameScoreTest.java
Normal file
@@ -0,0 +1,28 @@
|
||||
package net.woodyfolsom.msproj;
|
||||
|
||||
import static org.junit.Assert.assertEquals;
|
||||
|
||||
import net.woodyfolsom.msproj.GameScore;
|
||||
|
||||
import org.junit.Test;
|
||||
|
||||
public class GameScoreTest {
|
||||
|
||||
@Test
|
||||
public void testGetAggregateScoreZero() {
|
||||
GameScore gameScore = new GameScore(0,0,0);
|
||||
assertEquals(GameScore.NORMALIZED_ZERO_SCORE, gameScore.getAggregateScore());
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testGetAggregateScoreBlackWinsNoKomi() {
|
||||
GameScore gameScore = new GameScore(25,2,0);
|
||||
assertEquals(425, gameScore.getAggregateScore());
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testGetAggregateScoreWhiteWinsWithKomi() {
|
||||
GameScore gameScore = new GameScore(10,12,6.5);
|
||||
assertEquals(362, gameScore.getAggregateScore());
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user