Package org.swtpra1.alphabetaplayer
Class AlphaBetaWithTranspositionTablesPlayer
- java.lang.Object
-
- org.swtpra1.AIPlayer
-
- org.swtpra1.alphabetaplayer.AlphaBetaPlayer
-
- org.swtpra1.alphabetaplayer.AlphaBetaWithTranspositionTablesPlayer
-
public class AlphaBetaWithTranspositionTablesPlayer extends AlphaBetaPlayer
Player implementation that uses the AlphaBetaSearchTreeWithTranspositionTables
-
-
Field Summary
-
Fields inherited from class org.swtpra1.alphabetaplayer.AlphaBetaPlayer
alphaBeta, bufferTime, depth, evaluator, executor, iterativeDeepening, openingBook, openingBookFile, parallelism, presort
-
Fields inherited from class org.swtpra1.AIPlayer
BUFFER_TIME, DEFAULT_MAX_TURN_TIME
-
-
Constructor Summary
Constructors Constructor Description AlphaBetaWithTranspositionTablesPlayer()
create an Alpha beta search with transposition tables instace with sane defaults.AlphaBetaWithTranspositionTablesPlayer(Evaluator evaluator, int depth, boolean iterativeDeepening, long bufferTime, int parallelism, java.io.File openingBookFile, boolean presort)
Creates an alpha beta search instance with transposition tables that has fully customized values.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Turn
calculateTurn(int gameId, Board board, int playerId, Turn enemyTurn, long maxTurnTime)
Calculates the best possible turn in given time.void
newGame()
-
Methods inherited from class org.swtpra1.alphabetaplayer.AlphaBetaPlayer
calculateTurn
-
Methods inherited from class org.swtpra1.AIPlayer
generateQueensMoves, getAllPossibleTurns
-
-
-
-
Constructor Detail
-
AlphaBetaWithTranspositionTablesPlayer
public AlphaBetaWithTranspositionTablesPlayer()
create an Alpha beta search with transposition tables instace with sane defaults.
-
AlphaBetaWithTranspositionTablesPlayer
public AlphaBetaWithTranspositionTablesPlayer(Evaluator evaluator, int depth, boolean iterativeDeepening, long bufferTime, int parallelism, java.io.File openingBookFile, boolean presort)
Creates an alpha beta search instance with transposition tables that has fully customized values.- Parameters:
evaluator
- seeAlphaBetaPlayer.evaluator
depth
- seeAlphaBetaPlayer.depth
iterativeDeepening
- seeAlphaBetaPlayer.iterativeDeepening
bufferTime
- seeAlphaBetaPlayer.bufferTime
parallelism
- seeAlphaBetaPlayer.parallelism
openingBookFile
- seeAlphaBetaPlayer.openingBookFile
presort
- seeAlphaBetaPlayer.presort
-
-
Method Detail
-
calculateTurn
public Turn calculateTurn(int gameId, Board board, int playerId, Turn enemyTurn, long maxTurnTime)
Calculates the best possible turn in given time.- Overrides:
calculateTurn
in classAlphaBetaPlayer
- Parameters:
gameId
- the running gameboard
- the current board stateplayerId
- the id (0 or 1) of the player who we playenemyTurn
- what the enemy did in his last turnmaxTurnTime
- the time we have to find our turn- Returns:
- turn to play
-
-