Belofte version 2.1.8
A promising chess program using the UCI or Winboard interface
SearchAlphaBeta Class Reference

#include <search_ab.h>

+ Inheritance diagram for SearchAlphaBeta:
+ Collaboration diagram for SearchAlphaBeta:

Public Member Functions

 SearchAlphaBeta ()
 
 SearchAlphaBeta (std::string const &)
 
 ~SearchAlphaBeta () override
 
 SearchAlphaBeta (SearchAlphaBeta const &)=delete
 
 SearchAlphaBeta (SearchAlphaBeta &&)=delete
 
SearchAlphaBetaoperator= (SearchAlphaBeta const &)=delete
 
SearchAlphaBetaoperator= (SearchAlphaBeta &&)=delete
 
- Public Member Functions inherited from bSearchAlgorithm
 bSearchAlgorithm (std::string const &n)
 
 ~bSearchAlgorithm () override
 
 bSearchAlgorithm (bSearchAlgorithm const &)=delete
 
 bSearchAlgorithm (bSearchAlgorithm &&)=delete
 
bSearchAlgorithmoperator= (bSearchAlgorithm const &)=delete
 
bSearchAlgorithmoperator= (bSearchAlgorithm &&)=delete
 
 operator std::string () const &
 
int64_t getNodes () const
 
int64_t getNonLeafNodes () const
 
void StartSearch (bScore const m)
 
void StopSearch ()
 
void InterruptSearch ()
 
bBestMoveInfo SearchBestMove (bBoard &b)
 Generic search, will call (non-)recursive method per algorithm only when there are moves to be played.
 
bScore sendInfoSearching (bBoard const &b, depth_t const nDepth, std::string const &c, bScore const sc) const
 
bScore RetrieveBoardEvaluation (bBoard &b) const
 Cache score of board.
 
- Public Member Functions inherited from TimedExecution
 TimedExecution ()
 implementation of timing functions
 
virtual ~TimedExecution ()=default
 
std::string getDuration () const
 
long long getDurationMicroSec () const
 

Protected Member Functions

bScore CalcBestMove (bBoard &b) final
 
virtual bScore CalcBestMove (bBoard &b, depth_t const nDepth, bSearchScore alpha, bSearchScore beta)
 
bScore Quiescence (bBoard &b, depth_t const nDepth, bSearchScore alpha, bSearchScore beta, uint8_t nCheckCount)
 
- Protected Member Functions inherited from bSearchAlgorithm
void CheckIfAbortingSearch () const
 
bScore attenuateScore (bScore const sc) const
 converge score towards zero in order to force immediate best move first
 
void setLevel (bLevel *l)
 
bLevelgetLevel ()
 
void sendInfoCurrMove (bBoard const &b, depth_t const nDepth, movenum_t const moveid) const
 
bScore sendInfoScore (bBoard const &b, depth_t const nDepth, bScore const) const
 
void dumpMoveList (bBoard &b, depth_t const iDepth) const
 
- Protected Member Functions inherited from TimedExecution
void ClockStart ()
 
void ClockEnd ()
 
long long getDurationSec () const
 
long long getDurationMilliSec () const
 

Protected Attributes

bScore m_nBetaCutOffMargin
 

Additional Inherited Members

- Public Attributes inherited from bSearchAlgorithm
depth_t m_maxDepth = 0
 
int64_t m_nodes = 0LL
 
int64_t m_nonleafnodes = 0LL
 
bool m_iterativesearch = false
 

Detailed Description

Definition at line 13 of file search_ab.h.

Constructor & Destructor Documentation

◆ SearchAlphaBeta() [1/4]

SearchAlphaBeta::SearchAlphaBeta ( )

Definition at line 35 of file search_ab.cpp.

◆ SearchAlphaBeta() [2/4]

SearchAlphaBeta::SearchAlphaBeta ( std::string const &  s)
explicit

Definition at line 42 of file search_ab.cpp.

◆ ~SearchAlphaBeta()

SearchAlphaBeta::~SearchAlphaBeta ( )
override

Definition at line 49 of file search_ab.cpp.

◆ SearchAlphaBeta() [3/4]

SearchAlphaBeta::SearchAlphaBeta ( SearchAlphaBeta const &  )
delete

◆ SearchAlphaBeta() [4/4]

SearchAlphaBeta::SearchAlphaBeta ( SearchAlphaBeta &&  )
delete

Member Function Documentation

◆ operator=() [1/2]

SearchAlphaBeta & SearchAlphaBeta::operator= ( SearchAlphaBeta const &  )
delete

◆ operator=() [2/2]

SearchAlphaBeta & SearchAlphaBeta::operator= ( SearchAlphaBeta &&  )
delete

◆ CalcBestMove() [1/2]

bScore SearchAlphaBeta::CalcBestMove ( bBoard b)
finalprotectedvirtual

Implements bSearchAlgorithm.

Definition at line 53 of file search_ab.cpp.

Referenced by CalcBestMove(), and CalcBestMove().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ CalcBestMove() [2/2]

bScore SearchAlphaBeta::CalcBestMove ( bBoard b,
depth_t const  nDepth,
bSearchScore  alpha,
bSearchScore  beta 
)
protectedvirtual
Todo:
optimise

Reimplemented in SearchAlphaBetaFH.

Definition at line 84 of file search_ab.cpp.

+ Here is the call graph for this function:

◆ Quiescence()

bScore SearchAlphaBeta::Quiescence ( bBoard b,
depth_t const  nDepth,
bSearchScore  alpha,
bSearchScore  beta,
uint8_t  nCheckCount 
)
protected
Todo:
count move 0 as null-move (terminalScore)
Todo:
this is a bug in non-debug mode

Definition at line 216 of file search_ab.cpp.

Referenced by CalcBestMove(), SearchAlphaBetaFH::CalcBestMove(), and Quiescence().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

Member Data Documentation

◆ m_nBetaCutOffMargin

bScore SearchAlphaBeta::m_nBetaCutOffMargin
protected