Xiangiqgame
AI engine for Xiangqi
Loading...
Searching...
No Matches
boardstate::ZobristComponentForConcepts< C, N > Class Template Reference

Container for one or more boardstate::ZobristCalculatorForConcepts objects. More...

#include <zobrist_for_concepts.hpp>

Collaboration diagram for boardstate::ZobristComponentForConcepts< C, N >:
Collaboration graph

Public Types

using KeyType = typename C::KeyType
 

Public Member Functions

C::KeyType primary_board_state ()
 
std::array< typename C::KeyType, N > confirmation_board_states ()
 
C::KeyType primary_calculator_seed ()
 
std::array< uint32_t, N > confirmation_calculator_seeds () const
 
std::string primary_board_state_hex_str () const
 
uint32_t prng_seed ()
 

Static Public Member Functions

static std::shared_ptr< ZobristComponentForConcepts< C, N > > Create (uint32_t prng_seed=std::random_device{}())
 
static std::shared_ptr< ZobristComponentForConcepts< C, N > > Create (std::shared_ptr< C > primary_calculator, std::array< std::shared_ptr< C >, N > confirmation_calculators, std::uint32_t prng_seed=0)
 

Static Public Attributes

static size_t constexpr NumConfKeys = N
 

Private Member Functions

 ZobristComponentForConcepts (std::shared_ptr< C > primary_calculator, std::array< std::shared_ptr< C >, N > confirmation_calculators, uint32_t prng_seed=0)
 Constructs ZobristComponentForConcepts from existing ZobristCalculatorForConcepts objects.
 
std::array< typename C::KeyType, N > confirmation_board_states_internal ()
 
std::array< uint32_t, N > confirmation_calculator_seeds_internal () const
 

Private Attributes

std::shared_ptr< C > primary_calculator_
 
std::array< std::shared_ptr< C >, N > confirmation_calculators_
 
uint32_t prng_seed_
 

Detailed Description

template<SingleBoardStateProviderConcept C, size_t N>
class boardstate::ZobristComponentForConcepts< C, N >

Container for one or more boardstate::ZobristCalculatorForConcepts objects.

Using more than one boardstate::ZobristCalculatorForConcepts (i.e. N > 0) allows hash collisions to be detected.

Definition at line 27 of file zobrist_for_concepts.hpp.

Member Typedef Documentation

◆ KeyType

template<SingleBoardStateProviderConcept C, size_t N>
using boardstate::ZobristComponentForConcepts< C, N >::KeyType = typename C::KeyType

Definition at line 34 of file zobrist_for_concepts.hpp.

Constructor & Destructor Documentation

◆ ZobristComponentForConcepts()

template<SingleBoardStateProviderConcept C, size_t N>
boardstate::ZobristComponentForConcepts< C, N >::ZobristComponentForConcepts ( std::shared_ptr< C >  primary_calculator,
std::array< std::shared_ptr< C >, N >  confirmation_calculators,
uint32_t  prng_seed = 0 
)
inlineexplicitprivate

Constructs ZobristComponentForConcepts from existing ZobristCalculatorForConcepts objects.

Definition at line 90 of file zobrist_for_concepts.hpp.

Member Function Documentation

◆ confirmation_board_states()

template<SingleBoardStateProviderConcept C, size_t N>
std::array< typename C::KeyType, N > boardstate::ZobristComponentForConcepts< C, N >::confirmation_board_states ( )
inline

Definition at line 75 of file zobrist_for_concepts.hpp.

◆ confirmation_board_states_internal()

template<SingleBoardStateProviderConcept C, size_t N>
std::array< typename C::KeyType, N > boardstate::ZobristComponentForConcepts< C, N >::confirmation_board_states_internal ( )
inlineprivate

Definition at line 100 of file zobrist_for_concepts.hpp.

◆ confirmation_calculator_seeds()

template<SingleBoardStateProviderConcept C, size_t N>
std::array< uint32_t, N > boardstate::ZobristComponentForConcepts< C, N >::confirmation_calculator_seeds ( ) const
inline

Definition at line 79 of file zobrist_for_concepts.hpp.

◆ confirmation_calculator_seeds_internal()

template<SingleBoardStateProviderConcept C, size_t N>
std::array< uint32_t, N > boardstate::ZobristComponentForConcepts< C, N >::confirmation_calculator_seeds_internal ( ) const
inlineprivate

Definition at line 108 of file zobrist_for_concepts.hpp.

◆ Create() [1/2]

template<SingleBoardStateProviderConcept C, size_t N>
static std::shared_ptr< ZobristComponentForConcepts< C, N > > boardstate::ZobristComponentForConcepts< C, N >::Create ( std::shared_ptr< C >  primary_calculator,
std::array< std::shared_ptr< C >, N >  confirmation_calculators,
std::uint32_t  prng_seed = 0 
)
inlinestatic

Definition at line 59 of file zobrist_for_concepts.hpp.

◆ Create() [2/2]

template<SingleBoardStateProviderConcept C, size_t N>
static std::shared_ptr< ZobristComponentForConcepts< C, N > > boardstate::ZobristComponentForConcepts< C, N >::Create ( uint32_t  prng_seed = std::random_device{}())
inlinestatic

Definition at line 38 of file zobrist_for_concepts.hpp.

◆ primary_board_state()

template<SingleBoardStateProviderConcept C, size_t N>
C::KeyType boardstate::ZobristComponentForConcepts< C, N >::primary_board_state ( )
inline

Definition at line 74 of file zobrist_for_concepts.hpp.

◆ primary_board_state_hex_str()

template<SingleBoardStateProviderConcept C, size_t N>
std::string boardstate::ZobristComponentForConcepts< C, N >::primary_board_state_hex_str ( ) const
inline

Definition at line 82 of file zobrist_for_concepts.hpp.

◆ primary_calculator_seed()

template<SingleBoardStateProviderConcept C, size_t N>
C::KeyType boardstate::ZobristComponentForConcepts< C, N >::primary_calculator_seed ( )
inline

Definition at line 78 of file zobrist_for_concepts.hpp.

◆ prng_seed()

template<SingleBoardStateProviderConcept C, size_t N>
uint32_t boardstate::ZobristComponentForConcepts< C, N >::prng_seed ( )
inline

Definition at line 85 of file zobrist_for_concepts.hpp.

Member Data Documentation

◆ confirmation_calculators_

template<SingleBoardStateProviderConcept C, size_t N>
std::array<std::shared_ptr<C>, N> boardstate::ZobristComponentForConcepts< C, N >::confirmation_calculators_
private

Definition at line 30 of file zobrist_for_concepts.hpp.

◆ NumConfKeys

template<SingleBoardStateProviderConcept C, size_t N>
size_t constexpr boardstate::ZobristComponentForConcepts< C, N >::NumConfKeys = N
staticconstexpr

Definition at line 35 of file zobrist_for_concepts.hpp.

◆ primary_calculator_

template<SingleBoardStateProviderConcept C, size_t N>
std::shared_ptr<C> boardstate::ZobristComponentForConcepts< C, N >::primary_calculator_
private

Definition at line 29 of file zobrist_for_concepts.hpp.

◆ prng_seed_

template<SingleBoardStateProviderConcept C, size_t N>
uint32_t boardstate::ZobristComponentForConcepts< C, N >::prng_seed_
private

Definition at line 31 of file zobrist_for_concepts.hpp.


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