13 const char * what ()
const noexcept override
14 {
return "Game ended"; }
19 const char * what ()
const noexcept override
20 {
return "Nothing found"; }
25 const char * what ()
const noexcept override
26 {
return "Aborting search"; }
32#define DEBUG_sendInfoSearching(b, depth, msg, sc) sendInfoSearching(b, depth, msg, sc)
33#define DEBUG_sendInfoSearchingNS(b, depth, msg) sendInfoSearching(b, depth, msg)
35#define DEBUG_sendInfoSearching(b, depth, msg, sc)
36#define DEBUG_sendInfoSearchingNS(b, depth, msg)
39#if defined(BELOFTE_NOUNICODE)
43#define ALPHABETA "alpha-beta"
44#define BE_SEARCH "search"
47#define BE_UNDEFINED "UNDEF."
48#define BE_DRAW "1/2-1/2"
50#define GTOREQUAL " >= "
51#define CHECKSYMBOL " check"
56#define ALPHABETA "πΌπ½"
59#define BE_SEARCH "β
"
62#define BE_UNDEFINED "*"
63#define BE_DRAW "Β½-Β½"
65#define GTOREQUAL " β₯ "
66#define CHECKSYMBOL " β "
83 { m_levelptr =
nullptr; }
102 { m_aborting =
true; }
107 std::string
const& comment)
const;
109 std::string
const& comment,
115 {
return m_noBench; }
117 { m_noBench =
false; }
119 { m_noBench =
true; }
121 operator std::string() const&
122 {
return const_cast<std::string const&
>(m_name); }
133 {
if (nDepth > m_maxDepth) m_maxDepth = nDepth; }
135 {
return m_maxDepth; }
142 {
return m_levelptr; }
151 void dumpMoveList(
bBoard const& b,
depth_t const iDepth)
const;
154 bool m_noBench =
true;
157 std::atomic<bool> m_aborting;
TimedExecution()
implementation of timing functions
void adjustMaxSearchedDepth(depth_t const nDepth)
constexpr int64_t getNodes() const
void StartSearch(bScore const sc)
void sendInfoCurrMove(bBoard const &b, depth_t const nCurDepth, bMove const &m, movenum_t const moveid) const
void initMaxSearchedDepth()
constexpr bool isNoBench() const
~bSearchAlgorithm() override
void SearchBestMove(bBoard &b, bMoveList &ml)
Generic search, will call (non-)recursive method per algorithm only when there are moves to be played...
bSearchAlgorithm(std::string const &s)
bSearchAlgorithm(bSearchAlgorithm const &)=delete
bSearchAlgorithm(bSearchAlgorithm &&)=delete
constexpr depth_t getMaxSearchedDepth() const
bSearchAlgorithm & operator=(bSearchAlgorithm const &)=delete
bScore RetrieveBoardEvaluation(bBoard &b, gameResult_t const gr=GR_UNSET) const
Get score of board, eventually from cache.
void CheckIfAbortingSearch() const
void sendInfoSearching(bBoard const &b, depth_t const nDepth, std::string const &comment) const
bSearchAlgorithm & operator=(bSearchAlgorithm &&)=delete
constexpr int64_t getNonLeafNodes() const
virtual bScore CalcBestMove(bBoard &b, bMoveList &ml)=0
implementation of user interface
enum gameResult gameResult_t