67 {
return m_levelchanged; }
69 { m_levelchanged =
true; }
71 { m_levelchanged =
false; }
75 void setGameTime(
int const msPerGame,
int const msIncrementPerMove);
77 void setMoveTime(
int const msPerGame,
int const nMoves);
78 void setMoveTime(
int const msPerGame,
int const nMoves,
int const msIncrementPerMove);
88 { m_pondering =
true; }
90 { m_pondering =
false; }
92 {
return m_pondering; }
99 {
return m_nSearchDepth; }
103 {
return m_nQSDepth; }
107 {
return m_nMaxDepth; }
121 operator std::string()
const;
124 void recalibrateTime();
125 void adjustQSDepth();
126 std::string prettyDepth(
depth_t const d)
const;
127 std::string prettyMoves(
int const d)
const;
134 int m_nTimeForMove = 0;
135 int m_nTimeLeftForGame = 0;
136 int m_nRemainingMovesForPeriod = 0;
139 int m_nMaxTimeForMove = 0;
140 int m_nEstAllowNextIterationTime = 0;
141 int m_nAbsoluteAbortTime = 0;
144 bool m_levelchanged =
true;
145 bool m_pondering =
false;
146 int64_t m_nNodes = 0;
147 int m_timeForGame = 0;
148 int m_movesPerPeriod = 0;
149 int m_incrementPerMove = 0;
bool searchDepthReached(depth_t const d) const
bLevel & operator=(bLevel &&)=delete
void setGameTime(int const msPerGame)
constexpr depth_t getSearchDepth() const
void setMoreTimeRequired()
increase gradually the allowed time for move, first move to max time for move, then move to abort tim...
void setQSDepth(depth_t const d)
void setRemainingTime(int const msPerGame)
xboard issues time command to update available time
void setNodes(int64_t const n)
void setMoveTime(int const msPerMove)
void setSearchDepth(depth_t const d)
constexpr bool hasLevelChanged() const
bLevel & operator=(bLevel const &)=default
void setMateSearch(depth_t const d)
void setMoves(std::string movelist)
constexpr depth_t getQSDepth() const
constexpr LevelType getType() const
constexpr bool isPondering() const
bool qsDepthReached(depth_t const d) const
bool stoppingSearch(long const nTimeElapsed) const
Stop search required ?
void clearLevelChanged()
new level or new game
bLevel(bLevel const &)=default
void setMaxDepth(depth_t const d)
bool stillTimeLeft(depth_t const d, long const nTimeElapsed) const
Do we still have time to do another iteration ?
void setDepthCommand(depth_t const d)
void undoMovePlayed()
used for recalibrating time in case for undo move in xboard moves per period
constexpr depth_t getMaxDepth() const
constexpr auto TIME_OVERFLOWMULTIPLYER
constexpr auto TIME_UNDERFLOWDEVIDER
constexpr depth_t QS_DEPTHEXTENSION
constexpr auto TIME_UNDERFLOWMULTIPLYER
constexpr auto MINIMAL_DEPTH_COMPLETED
constexpr auto TIME_LOSTINENGINE
time lost in between UI go command and bestmove return
constexpr depth_t DEFAULT_DEPTH
constexpr depth_t INFINITE_DEPTH
LevelType
Implements clock n seconds per game - setGameTime(seconds * 1000) n seconds per game,...
constexpr auto TIME_LASTMOVEMARGIN