Package a5.ai
Class TranspositionTable<GameState>
java.lang.Object
a5.ai.TranspositionTable<GameState>
- Type Parameters:
GameState
- A type representing the state of a game.
A transposition table for an arbitrary game. It maps a game state
to a search depth and a heuristic evaluation of that state to the
recorded depth. Unlike a conventional map abstraction, a state is
associated with a depth, so that clients can look for states whose
entry has at least the desired depth.
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic interface
Information about a game state, for use by clients. -
Method Summary
Modifier and TypeMethodDescriptionvoid
Effect: Add a new entry in the transposition table for a given state and depth, or overwrite the existing entry for this state with the new depth and value.Returns: the information in the transposition table for a given game state, package in an Optional.int
size()
The number of entries in the transposition table.
-
Method Details
-
size
public int size()The number of entries in the transposition table. -
getInfo
Returns: the information in the transposition table for a given game state, package in an Optional. If there is no information in the table for this state, returns an empty Optional. -
add
Effect: Add a new entry in the transposition table for a given state and depth, or overwrite the existing entry for this state with the new depth and value. Requires: if overwriting an existing entry, the new depth must be greater than the old one.
-