Xiangiqgame
AI engine for Xiangqi
|
Uses Zobrist hashing to calculate a "reasonably unique" integer value for each board configuration encountered during a game. More...
#include <zobrist_calculator_for_concepts.hpp>
Public Types | |
using | KeyType = K |
Public Member Functions | |
KeyType | board_state () const |
uint32_t | seed () const |
void | FullBoardStateCalc (const gameboard::BoardMap_t &board_map) |
void | UpdateBoardState (const gameboard::ExecutedMove &executed_move) |
Static Public Member Functions | |
static std::shared_ptr< ZobristCalculatorForConcepts< K > > | Create (uint32_t seed=std::random_device{}()) |
Private Types | |
using | PieceZarray_t = array< array< K, gameboard::kNumFiles >, gameboard::kNumRanks > |
using | TeamZarray_t = array< PieceZarray_t, gameboard::kNumPieceTypeVals > |
using | GameZarray_t = array< TeamZarray_t, 2 > |
Private Member Functions | |
ZobristCalculatorForConcepts (uint32_t seed=std::random_device{}()) | |
Constructs a ZobristCalculatorForConcepts. | |
K | GetHashValueAt (PieceColor color, PieceType piece_type, BoardSpace space) |
void | FullBoardStateCalcInternal (const gameboard::BoardMap_t &board_map) |
void | UpdateBoardStateInternal (const gameboard::ExecutedMove &executed_move) |
Static Private Member Functions | |
static const GameZarray_t | CreateGameZarray (PseudoRandomKeyGenerator< K > &key_generator) |
Static helper method for building 4-D array of Zobrist keys in constuctor. | |
Private Attributes | |
GameZarray_t | zarray_ |
K | turn_key_ |
uint32_t | seed_ |
K | board_state_ |
Uses Zobrist hashing to calculate a "reasonably unique" integer value for each board configuration encountered during a game.
K can be any unsigned integer type with a size = (n * 32 bits) where n is an integer >= 1.
Definition at line 13 of file zobrist_calculator_for_concepts.hpp.
|
private |
Definition at line 19 of file zobrist_calculator_for_concepts.hpp.
using boardstate::ZobristCalculatorForConcepts< K >::KeyType = K |
Definition at line 27 of file zobrist_calculator_for_concepts.hpp.
|
private |
Definition at line 17 of file zobrist_calculator_for_concepts.hpp.
|
private |
Definition at line 18 of file zobrist_calculator_for_concepts.hpp.
|
inlineprivate |
Constructs a ZobristCalculatorForConcepts.
seed | Integer used as a seed for a PRNG that generates Zobrist key values. |
Definition at line 52 of file zobrist_calculator_for_concepts.hpp.
|
inline |
Definition at line 37 of file zobrist_calculator_for_concepts.hpp.
|
inlinestatic |
Definition at line 28 of file zobrist_calculator_for_concepts.hpp.
|
inlinestaticprivate |
Static helper method for building 4-D array of Zobrist keys in constuctor.
Definition at line 63 of file zobrist_calculator_for_concepts.hpp.
|
inline |
Definition at line 41 of file zobrist_calculator_for_concepts.hpp.
|
inlineprivate |
Definition at line 84 of file zobrist_calculator_for_concepts.hpp.
|
inlineprivate |
Definition at line 78 of file zobrist_calculator_for_concepts.hpp.
|
inline |
Definition at line 38 of file zobrist_calculator_for_concepts.hpp.
|
inline |
Definition at line 45 of file zobrist_calculator_for_concepts.hpp.
|
inlineprivate |
Definition at line 99 of file zobrist_calculator_for_concepts.hpp.
|
private |
Definition at line 24 of file zobrist_calculator_for_concepts.hpp.
|
private |
Definition at line 23 of file zobrist_calculator_for_concepts.hpp.
|
private |
Definition at line 22 of file zobrist_calculator_for_concepts.hpp.
|
private |
Definition at line 21 of file zobrist_calculator_for_concepts.hpp.