game_solver::transposition

Trait TranspositionTable

source
pub trait TranspositionTable<T: Eq + Hash + Game> {
    // Required methods
    fn get(&self, board: &T) -> Option<Score>;
    fn insert(&mut self, board: T, score: Score);
    fn has(&self, board: &T) -> bool;
}
Expand description

A memoization strategy for a perfect-information sequential game.

Required Methods§

source

fn get(&self, board: &T) -> Option<Score>

Get the score of a board, if it exists.

source

fn insert(&mut self, board: T, score: Score)

Insert a board into the transposition table.

source

fn has(&self, board: &T) -> bool

Returns true if the board is in the transposition table.

Implementations on Foreign Types§

source§

impl<K: Eq + Hash + Game + Send + Sync + 'static, S: BuildHasher + Default + Send + Sync + Clone + 'static> TranspositionTable<K> for Arc<TranspositionCache<K, S>>

source§

fn get(&self, board: &K) -> Option<Score>

source§

fn insert(&mut self, board: K, score: Score)

source§

fn has(&self, board: &K) -> bool

source§

impl<K: Eq + Hash + Game, S: BuildHasher + Default> TranspositionTable<K> for HashMap<K, Score, S>

source§

fn get(&self, board: &K) -> Option<Score>

source§

fn insert(&mut self, board: K, score: Score)

source§

fn has(&self, board: &K) -> bool

Implementors§