"oponent" to "opponent"
This commit is contained in:
Mohamed El Tahawy 2018-05-22 16:18:23 +04:00 committed by GitHub
parent d98b696baa
commit 5a92adbc39
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 4 additions and 4 deletions

View File

@ -10,7 +10,7 @@ public class MonteCarloTreeSearch {
private static final int WIN_SCORE = 10; private static final int WIN_SCORE = 10;
private int level; private int level;
private int oponent; private int opponent;
public MonteCarloTreeSearch() { public MonteCarloTreeSearch() {
this.level = 3; this.level = 3;
@ -32,11 +32,11 @@ public class MonteCarloTreeSearch {
long start = System.currentTimeMillis(); long start = System.currentTimeMillis();
long end = start + 60 * getMillisForCurrentLevel(); long end = start + 60 * getMillisForCurrentLevel();
oponent = 3 - playerNo; opponent = 3 - playerNo;
Tree tree = new Tree(); Tree tree = new Tree();
Node rootNode = tree.getRoot(); Node rootNode = tree.getRoot();
rootNode.getState().setBoard(board); rootNode.getState().setBoard(board);
rootNode.getState().setPlayerNo(oponent); rootNode.getState().setPlayerNo(opponent);
while (System.currentTimeMillis() < end) { while (System.currentTimeMillis() < end) {
// Phase 1 - Selection // Phase 1 - Selection
@ -93,7 +93,7 @@ public class MonteCarloTreeSearch {
State tempState = tempNode.getState(); State tempState = tempNode.getState();
int boardStatus = tempState.getBoard().checkStatus(); int boardStatus = tempState.getBoard().checkStatus();
if (boardStatus == oponent) { if (boardStatus == opponent) {
tempNode.getParent().getState().setWinScore(Integer.MIN_VALUE); tempNode.getParent().getState().setWinScore(Integer.MIN_VALUE);
return boardStatus; return boardStatus;
} }