Class AlphaBetaSearchTreeWithTranspositionTables
- java.lang.Object
-
- org.swtpra1.alphabetaplayer.alphabeta.AlphaBetaSearchTree
-
- org.swtpra1.alphabetaplayer.transpositiontables.AlphaBetaSearchTreeWithTranspositionTables
-
public class AlphaBetaSearchTreeWithTranspositionTables extends AlphaBetaSearchTree
Implements the negamax search algorithm with alpha beta pruning and transposition table optimization.
-
-
Field Summary
Fields Modifier and Type Field Description java.util.concurrent.atomic.AtomicLong
transCount
-
Fields inherited from class org.swtpra1.alphabetaplayer.alphabeta.AlphaBetaSearchTree
evaluator, executor, parallelism
-
-
Constructor Summary
Constructors Constructor Description AlphaBetaSearchTreeWithTranspositionTables(Evaluator evaluator, int parallelism)
Creates a search tree instance of negamax search with alpha beta pruning and transposition table optimization.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
clearTranspositionTable()
protected ValuedTurn
negamax(Board board, int player, int depth, boolean presort, float alpha, float beta, java.util.List<Turn> blacklist)
Searches for the best turn using negamax search with alpha beta pruning and transposition tables.ValuedTurn
negamax(Board board, int player, int depth, boolean presort, java.util.List<Turn> blacklist)
Searches for the best turn using negamax search with alpha beta pruning and transposition tables.-
Methods inherited from class org.swtpra1.alphabetaplayer.alphabeta.AlphaBetaSearchTree
chooseMostPromisingTurns, negamax, negamax, parallelNegamax
-
-
-
-
Constructor Detail
-
AlphaBetaSearchTreeWithTranspositionTables
public AlphaBetaSearchTreeWithTranspositionTables(Evaluator evaluator, int parallelism)
Creates a search tree instance of negamax search with alpha beta pruning and transposition table optimization.- Parameters:
evaluator
- the evaluator to use to evaluate board positionsparallelism
- seeAlphaBetaPlayer.parallelism
-
-
Method Detail
-
negamax
public ValuedTurn negamax(Board board, int player, int depth, boolean presort, java.util.List<Turn> blacklist)
Searches for the best turn using negamax search with alpha beta pruning and transposition tables.- Overrides:
negamax
in classAlphaBetaSearchTree
- Parameters:
board
- the current state of the boardplayer
- the id (0 or 1) of the player on this layerdepth
- the maximum depth to be consideredpresort
- whether to presort the moves and cut offblacklist
- moves that should never be considered- Returns:
- best possible turn with its evaluation
-
negamax
protected ValuedTurn negamax(Board board, int player, int depth, boolean presort, float alpha, float beta, java.util.List<Turn> blacklist)
Searches for the best turn using negamax search with alpha beta pruning and transposition tables.- Overrides:
negamax
in classAlphaBetaSearchTree
- Parameters:
board
- the current state of the boardplayer
- the id (0 or 1) of the player on this layerdepth
- the maximum depth to be consideredpresort
- whether to presort the moves and cut offalpha
- to determine whether better moves can be foundbeta
- to determine whether better moves can be foundblacklist
- moves that should never be considered- Returns:
- best possible turn with its evaluation
-
clearTranspositionTable
public void clearTranspositionTable()
-
-