19 : m_score{std::move(sc.m_score)}
20 , m_type{std::move(sc.m_type)}
37 m_score = std::move(sc.m_score);
38 m_type = std::move(sc.m_type);
52 m_score = std::move(sc);
75 return lhs + sc.operator std::string();
80 return sc.operator std::string() + rhs;
103bSearchScore::operator std::string()
const
106 return belofte::scoreAsStr(m_score);
107#if defined(BELOFTE_NOUNICODE)
109 return "alpha: " + belofte::scoreAsStr(m_score);
111 return "beta: " + belofte::scoreAsStr(m_score);
113 return "search: " + belofte::scoreAsStr(m_score);
115 return "best: " + belofte::scoreAsStr(m_score);
118 return "𝛼: " + belofte::scoreAsStr(m_score);
120 return "𝛽: " + belofte::scoreAsStr(m_score);
122 return "⅀: " + belofte::scoreAsStr(m_score);
124 return "↑: " + belofte::scoreAsStr(m_score);
127 return belofte::scoreAsStr(m_score);
135 , m_levelptr{nullptr}
141 m_levelptr =
nullptr;
158 std::stringstream ss;
159 ss <<
"Searching started: " << this->
operator std::string() <<
" "
160 <<
getLevel()->operator std::string()
161 << (b.
whiteToMove() ?
" For white" :
" For Black");
178 result = SearchBestMoveIterative(b);
207 while (iCurrentDepth <=
getLevel()->getMaxDepth()) {
210 std::string sDepth =
"(depth " + belofte::to_string(iCurrentDepth) +
")";
218 if (nDuration < 1) nDuration = 1;
219 long nNPS = nNodes * 1000000 / nDuration;
224 }
catch (...) {
throw;
247 if (iCurrentDepth <=
getLevel()->getMaxDepth()) {
293 std::stringstream ss;
294 if (iDepth) ss <<
"depth " << belofte::to_string(iDepth) <<
" ";
302 depth_t const nDepth, std::string
const& c,
305 if (nDepth <= m_postlevel) {
308 this->
operator std::string() +
" " +
320 if (nDepth <= m_postlevel) {
330 if (nDepth < m_postlevel) {
engineInterface * AppEI()
This is the main include file, needs to be included before any other include.
std::string getDuration() const
long long getDurationMilliSec() const
long long getDurationMicroSec() const
outputWriter sout
normal output
bMove const & getMove(movenum_t const moveid) const
bMoveList & getMoveListRef()
return reference to movelist
void setBoardEvaluation(bScore const s)
bScore minimizing() const
bScore getBoardEvaluation() const
void setPreviousMoves(movesequence_t const &v)
bScore EvalForPlayer(bBoard const &b)
void setSearchDepth(depth_t const d)
bool stoppingSearch(long const nTimeElapsed) const
Stop search required ?
movenum_t generateMoves(bBoard const &b)
generate moves if not yet generated
void sendInfoCurrMove(bBoard const &b, depth_t const nDepth, movenum_t const moveid) const
bScore attenuateScore(bScore const sc) const
converge score towards zero in order to force immediate best move first
bScore RetrieveBoardEvaluation(bBoard &b) const
Cache score of board.
~bSearchAlgorithm() override
virtual bScore CalcBestMove(bBoard &b)=0
bScore sendInfoScore(bBoard const &b, depth_t const nDepth, bScore const) const
bScore sendInfoSearching(bBoard const &b, depth_t const nDepth, std::string const &c, bScore const sc) const
bSearchAlgorithm(std::string const &n)
void CheckIfAbortingSearch() const
bBestMoveInfo SearchBestMove(bBoard &b)
Generic search, will call (non-)recursive method per algorithm only when there are moves to be played...
void StartSearch(bScore const m)
void dumpMoveList(bBoard &b, depth_t const iDepth) const
bSearchScore operator-() const
bSearchScore & operator=(bSearchScore &&sc) noexcept
bScore getRealScore() const
bSearchScore(bSearchScore const &sc) noexcept
virtual void sendInfoSearching(bBoard const &b, int const nLogDepth, depth_t const nMaxDepth, std::string const &comment, bScore const sc, int64_t const t, int64_t const nodes) const
virtual void sendInfoCurrMove(bBoard const &b, depth_t const nLogDepth, depth_t const nMaxDepth, std::string const &comment, bMove const &m, movenum_t const moveid, int64_t const nodes) const
virtual void sendDebug(int const l, std::string const &info)
virtual void sendInfoScore(long long timems, bBoard const &b, bScore const cp)
virtual void sendInfo(std::string const &info)
virtual void sendError(std::string const &error, std::string const &description)
virtual void sendInfoDepth(int depth, int seldepth, int64_t nodes, int nps)
constexpr bScore SCORE_ALMOST_NORMAL
constexpr bScore SCORE_PUNDEFINED
constexpr bScore SCORE_ALMOST_DRAW
constexpr bScore SCORE_CONVERGE_BYDEPTH
constexpr bScore SCORE_WINNING
constexpr bScore SCORE_POSITIVE
constexpr bScore SCORE_UNDEFINED
constexpr bScore SCORE_THEORETIC_DRAW
bScore realScore(bScore const sc)
std::string const operator+(std::string const &lhs, bSearchScore const &sc)
bool operator>(bScore const &lhsc, bSearchScore const &rhsc)
bool operator>=(bScore const &lhsc, bSearchScore const &rhsc)
enum tScoreType scoretype_t