18 }
else if (args ==
"off") {
23 }
else if (args ==
"show fen") {
25 }
else if (args ==
"help") {
27 }
else if (args ==
"gamehistory") {
28 App().
bout << show_gamehistory();
29 }
else if (args ==
"fenhistory") {
30 App().
bout << show_fenhistory();
31 }
else if (args ==
"poshistory") {
32 App().
bout << show_poshistory();
33 }
else if (args ==
"hashhistory") {
34 App().
bout << show_hashhistory();
35 }
else if (args ==
"autosave") {
36 App().
bout <<
"not implemented yet\n";
37 }
else if (args ==
"logging") {
38 App().
bout <<
"not implemented yet\n";
39 }
else if (args ==
"ml") {
44 App().
bout <<
"info string ml " << ml <<
"\n";
45 App().
bout <<
"info string ml " << pml <<
"\n";
46 }
else if (args ==
"sortmoves") {
52 App().
bout <<
"info string ml " << ml <<
"\n";
53 App().
bout <<
"info string ml " << pml <<
"\n";
54 }
else if (args ==
"setrunning") {
56 }
else if (args ==
"wait") {
58 }
else if (args ==
"invert") {
60 }
else if (args ==
"log on") {
62 }
else if (args ==
"log off") {
64 }
else if (args ==
"search on") {
66 }
else if (args ==
"search off") {
68 }
else if (args ==
"verbose 0") {
71 }
else if (args ==
"verbose 1") {
73 }
else if (args ==
"verbose 2") {
75 }
else if (args ==
"verbose 3") {
77 }
else if (args ==
"verbose 4") {
79 }
else if (args ==
"verbose 5") {
81 }
else if (args ==
"verbose all") {
83 }
else if (args ==
"") {
96#if defined(CHRONO_MISSING)
97 App().
bout <<
" CHRONO_MISSING";
99#if defined(BELOFTE_NORANDOM)
100 App().
bout <<
" BELOFTE_NORANDOM";
102#if defined(BELOFTE_UCIMODE)
103 App().
bout <<
" BELOFTE_UCIMODE";
105#if defined(BELOFTE_NOSIGNALS)
106 App().
bout <<
" BELOFTE_NOSIGNALS";
108#if defined(BELOFTE_NOUNICODE)
109 App().
bout <<
" BELOFTE_NOUNICODE";
111#if defined(INCOMPLETE_C11)
112 App().
bout <<
" INCOMPLETE_C11";
117#if defined(_WIN32) || defined(WIN32)
123#if defined(NO_NPS_LOG)
129 <<
"Mode: " <<
AppEI()->operator std::string() <<
" - "
137 <<
"Eval: " <<
Game()->
getEval()->operator std::string()
149 int64_t nNonLeafNodes;
160 Game()->
setFEN(
"n1n5/PPPk4/8/8/8/8/4Kppp/5N1N b - - 0 1");
165 App().
bout(-1) <<
"bench " << search.operator std::string()
169#if !defined(NO_NPS_LOG)
170 <<
" NPS: " <<
belofte::to_string(
static_cast<int64_t
>((nNonLeafNodes + nNodes) * 1000000LL / nDuration))
179void bel_debug::wait()
181 if (
App().m_reader.isBatchMode()) {
182 while (
Game()->isSearching()) {
194std::string bel_debug::show_help()
196 std::stringstream os;
197 os <<
"debug help - this message" <<
"\n"
198 <<
"debug [off|on] - set level 50, 0 or 99, toggle UCI debug" <<
"\n"
199 <<
"debug verbose n - set level n (can be 0-5)" <<
"\n"
200 <<
"debug verbose all - set level 99" <<
"\n"
201 <<
"debug log on - activate logfile for ui protocol" <<
"\n"
202 <<
"debug log off - de-activate logfile for ui protocol" <<
"\n"
203 <<
"debug search on - activate logfile for search" <<
"\n"
204 <<
"debug search off - de-activate logfile for search" <<
"\n"
205 <<
"debug show fen - display FEN string of current position" <<
"\n"
206 <<
"debug ml - show moves calculated for current position" <<
"\n"
207 <<
"debug sortmoves - sort moves and show moves calculated" <<
"\n"
208 <<
"debug invert - invert colours" <<
"\n"
209 <<
"debug gamehistory - show complete game" <<
"\n"
210 <<
"debug fenhistory - show all fen strings of game" <<
"\n"
211 <<
"debug poshistory - show positions of game" <<
"\n"
212 <<
"debug setrunning - set xboard persistent running state" <<
"\n"
213 <<
"debug wait - wait for previous batch command to finish" <<
"\n";
221std::string bel_debug::show_gamehistory()
223 std::stringstream os;
226 for (bBoard
const& b : positions) {
230 os << b.getFEN() <<
"\n"
246std::string bel_debug::show_poshistory()
248 std::stringstream os;
251 for (bBoard
const& b : positions) {
261std::string bel_debug::show_fenhistory()
263 std::stringstream os;
266 for (bBoard
const& b : positions) {
267 os << b.getFEN() <<
"\n";
276std::string bel_debug::show_hashhistory()
278 std::stringstream os;
281 for (bBoard
const& b : positions) {
282 os << b.getHashStr() <<
" : " << b.getFEN() <<
"\n";
engineInterface * AppEI()
This is the main include file, needs to be included before any other include.
static void sleep_ms(unsigned long ms)
Class static function Pause execution for a number of ms.
long long getDurationMicroSec() const
outputWriter sout
normal output
static std::string getName()
void setConfig(std::string const &s, int64_t v)
int64_t getConfig(std::string const &s, int64_t v)
void invertColours()
invert colours update kingpos, update colour to move, castle rights, ...
bSearchAlgorithm * getAlgorithm() const
bPositionEvaluation * getEval() const
int64_t DoPerft(bSearchAlgorithm &sa, depth_t const d)
do perft search at depth in case of Perft algorithm, temporarily set evaltype to None
positions_t & getPositions()
void setFEN(std::string const &fenstr)
bBoard & getCurrentPosition()
movenum_t generateMoves(bBasicBoard const &b)
generate moves if not yet generated
void sortMoves(bool const bFastSort)
sort moves and update bestmove id if less than 5 moves, sort all if more than 5 moves,...
constexpr int64_t getNonLeafNodes() const
static void run_bench(bSearchAlgorithm &search, depth_t const nDepth)
static void execute(std::string const &args)
virtual void setRunning(bool const r)
virtual void sendError(std::string const &error, std::string const &description)
std::string const & fn() const
bool attach(std::string const &fn)
void setLevel(int const l)
std::vector< bBoard > positions_t
std::string to_string(int16_t value)
std::to_string not compatible on Mac OS (Apple LLVM version 5.0) provide generic utility function
std::string prettyTime(long const nTime)