Xiangiqgame
AI engine for Xiangqi
Loading...
Searching...
No Matches
boardstate::TranspositionTable< KeyType, NumConfKeys > Class Template Reference

Stores and manages key-value pairs consisting of a board_state (from a boardstate::ZobristComponent) and results of Minimax calculations performed by boardstate::MinimaxMoveEvaluator. More...

#include <zobrist.hpp>

Collaboration diagram for boardstate::TranspositionTable< KeyType, NumConfKeys >:
Collaboration graph

Public Member Functions

 TranspositionTable ()=default
 
moveselection::TranspositionTableSearchResult GetDataAt (KeyType primary_board_state, DepthType remaining_search_depth, std::array< KeyType, NumConfKeys > expected_keys)
 
void RecordData (KeyType primary_board_state, DepthType search_depth, moveselection::MinimaxResultType result_type, moveselection::EqualScoreMoves &similar_moves, const std::array< KeyType, NumConfKeys > &confirmation_keys)
 
size_t size ()
 
void IncrementMoveCounter ()
 
MoveCountType NumIdleMovesAt (KeyType board_state)
 

Private Member Functions

MoveCountType NumMovesSinceLastUseOf (const TranspositionTableEntry< KeyType, NumConfKeys > &tr_table_entry)
 

Private Attributes

std::unordered_map< KeyType, TranspositionTableEntry< KeyType, NumConfKeys > > data_
 
MoveCountType move_counter_
 

Detailed Description

template<typename KeyType, size_t NumConfKeys>
class boardstate::TranspositionTable< KeyType, NumConfKeys >

Stores and manages key-value pairs consisting of a board_state (from a boardstate::ZobristComponent) and results of Minimax calculations performed by boardstate::MinimaxMoveEvaluator.

Provides read/write access to moveselection::MinimaxMoveEvaluator via a boardstate::ZobristCoordinator.

Definition at line 279 of file zobrist.hpp.

Constructor & Destructor Documentation

◆ TranspositionTable()

template<typename KeyType , size_t NumConfKeys>
boardstate::TranspositionTable< KeyType, NumConfKeys >::TranspositionTable ( )
default

Member Function Documentation

◆ GetDataAt()

template<typename KeyType , size_t NumConfKeys>
moveselection::TranspositionTableSearchResult boardstate::TranspositionTable< KeyType, NumConfKeys >::GetDataAt ( KeyType  primary_board_state,
DepthType  remaining_search_depth,
std::array< KeyType, NumConfKeys >  expected_keys 
)
inline

Definition at line 286 of file zobrist.hpp.

◆ IncrementMoveCounter()

template<typename KeyType , size_t NumConfKeys>
void boardstate::TranspositionTable< KeyType, NumConfKeys >::IncrementMoveCounter ( )
inline

Definition at line 327 of file zobrist.hpp.

◆ NumIdleMovesAt()

template<typename KeyType , size_t NumConfKeys>
MoveCountType boardstate::TranspositionTable< KeyType, NumConfKeys >::NumIdleMovesAt ( KeyType  board_state)
inline

Definition at line 329 of file zobrist.hpp.

◆ NumMovesSinceLastUseOf()

template<typename KeyType , size_t NumConfKeys>
MoveCountType boardstate::TranspositionTable< KeyType, NumConfKeys >::NumMovesSinceLastUseOf ( const TranspositionTableEntry< KeyType, NumConfKeys > &  tr_table_entry)
inlineprivate

Definition at line 335 of file zobrist.hpp.

◆ RecordData()

template<typename KeyType , size_t NumConfKeys>
void boardstate::TranspositionTable< KeyType, NumConfKeys >::RecordData ( KeyType  primary_board_state,
DepthType  search_depth,
moveselection::MinimaxResultType  result_type,
moveselection::EqualScoreMoves similar_moves,
const std::array< KeyType, NumConfKeys > &  confirmation_keys 
)
inline

Definition at line 308 of file zobrist.hpp.

◆ size()

template<typename KeyType , size_t NumConfKeys>
size_t boardstate::TranspositionTable< KeyType, NumConfKeys >::size ( )
inline

Definition at line 325 of file zobrist.hpp.

Member Data Documentation

◆ data_

template<typename KeyType , size_t NumConfKeys>
std::unordered_map<KeyType, TranspositionTableEntry<KeyType, NumConfKeys> > boardstate::TranspositionTable< KeyType, NumConfKeys >::data_
private

Definition at line 280 of file zobrist.hpp.

◆ move_counter_

template<typename KeyType , size_t NumConfKeys>
MoveCountType boardstate::TranspositionTable< KeyType, NumConfKeys >::move_counter_
private

Definition at line 281 of file zobrist.hpp.


The documentation for this class was generated from the following file: