23 }
else if (args ==
"off") {
28 }
else if (args ==
"show fen") {
30 }
else if (args ==
"help") {
32 }
else if (args ==
"gamehistory") {
33 App().
bout << show_gamehistory();
34 }
else if (args ==
"fenhistory") {
35 App().
bout << show_fenhistory();
36 }
else if (args ==
"poshistory") {
37 App().
bout << show_poshistory();
38 }
else if (args ==
"hashhistory") {
39 App().
bout << show_hashhistory();
40 }
else if (args ==
"autosave") {
41 App().
bout <<
"not implemented yet \n";
42 }
else if (args ==
"logging") {
43 App().
bout <<
"not implemented yet \n";
44 }
else if (args ==
"ml") {
49 App().
bout <<
"info string ml " << ml <<
"\n";
50 App().
bout <<
"info string ml " << pml <<
"\n";
51 }
else if (args ==
"setrunning") {
53 }
else if (args ==
"invert") {
55 }
else if (args ==
"log on") {
57 }
else if (args ==
"log off") {
59 }
else if (args ==
"verbose 0") {
62 }
else if (args ==
"verbose 1") {
64 }
else if (args ==
"verbose 2") {
66 }
else if (args ==
"verbose 3") {
68 }
else if (args ==
"verbose 4") {
70 }
else if (args ==
"verbose all") {
72 }
else if (args ==
"") {
85#if defined(CHRONO_MISSING)
86 App().
bout <<
" CHRONO_MISSING";
88#if defined(BELOFTE_NORANDOM)
89 App().
bout <<
" BELOFTE_NORANDOM";
91#if defined(BELOFTE_UCIMODE)
92 App().
bout <<
" BELOFTE_UCIMODE";
94#if defined(BELOFTE_NOSIGNALS)
95 App().
bout <<
" BELOFTE_NOSIGNALS";
97#if defined(BELOFTE_NOUNICODE)
98 App().
bout <<
" BELOFTE_NOUNICODE";
100#if defined(INCOMPLETE_C11)
101 App().
bout <<
" INCOMPLETE_C11";
106#if defined(_WIN32) || defined(WIN32)
114 App().
bout <<
"Output detail -"
115 " interface: " << belofte::to_string(
App().bout.getLevel())
116 <<
", search: " << belofte::to_string(
App().sout.getLevel())
121 <<
"Mode: " <<
AppEI()->operator std::string() <<
"\n"
122 <<
"Eval: " <<
Game()->
getEval()->operator std::string()
134 int64_t nNonLeafNodes;
145 Game()->
setFEN(
"n1n5/PPPk4/8/8/8/8/4Kppp/5N1N b - - 0 1");
150 std::stringstream ss;
151 ss <<
"bench " << search.operator std::string()
152 <<
" Time: " << belofte::prettyTime(nDuration / 1000LL)
153 <<
" Nodes: " << belofte::to_string(nNodes)
154 <<
" Total N.: " << belofte::to_string(nNonLeafNodes + nNodes)
155 <<
" NPS: " << belofte::to_string(
static_cast<int64_t
>((nNonLeafNodes + nNodes) * 1000000LL / nDuration));
160std::string bel_debug::show_help()
const
162 std::stringstream os;
163 os <<
"debug help - this message" <<
"\n"
164 <<
"debug [off|on] - set level 50, 0 or 99" <<
"\n"
165 <<
"debug verbose n - set level n (can be 0-5)" <<
"\n"
166 <<
"debug verbose all - set level 99" <<
"\n"
167 <<
"debug log on - activate logfile" <<
"\n"
168 <<
"debug log off - de-activate logfile" <<
"\n"
169 <<
"debug show fen - display FEN string of current position" <<
"\n"
170 <<
"debug ml - show moves calculated for current position" <<
"\n"
171 <<
"debug invert - invert colours" <<
"\n"
172 <<
"debug gamehistory - show complete game" <<
"\n"
173 <<
"debug fenhistory - show all fen strings of game" <<
"\n"
174 <<
"debug poshistory - show positions of game" <<
"\n"
175 <<
"debug setrunning - set xboard persistent running state" <<
"\n";
180std::string bel_debug::show_gamehistory()
const
182 std::stringstream os;
185 for (
bBoard& b : positions) {
190 os << b.getFEN() <<
"\n"
199std::string bel_debug::show_poshistory()
const
201 std::stringstream os;
204 for (
bBoard const& b : positions) {
211std::string bel_debug::show_fenhistory()
const
213 std::stringstream os;
216 for (
bBoard const& b : positions) {
217 os << b.getFEN() <<
"\n";
223std::string bel_debug::show_hashhistory()
const
225 std::stringstream os;
228 for (
bBoard const& b : positions) {
229 os << b.getHashStr() <<
" : " << b.getFEN() <<
"\n";
241#pragma GCC diagnostic push
242#pragma GCC diagnostic ignored "-Wunused-parameter"
253#pragma GCC diagnostic pop
261 m_fos.open(
fn.c_str(), std::ios::out | std::ios::trunc );
262 if (m_fos.is_open()) {
266 return m_fos.is_open();
engineInterface * AppEI()
This is the main include file, needs to be included before any other include.
long long getDurationMicroSec() const
outputWriter sout
normal output
int64_t getConfig(std::string const &s, int64_t v)
std::string getName() const
void invertColours()
invert colours update kingpos, update colour to move, castle rights, ...
bMoveList & getMoveListRef()
return reference to movelist
bSearchAlgorithm * getAlgorithm() const
bPositionEvaluation * getEval() const
positions_t & getPositions()
void setFEN(std::string const &fenstr)
int64_t DoPerft(bSearchAlgorithm &sa, int const d)
do perft search at depth
bBoard & getCurrentPosition()
movenum_t generateMoves(bBoard const &b)
generate moves if not yet generated
int64_t getNonLeafNodes() const
static void run_bench(bSearchAlgorithm &search, depth_t const nDepth)
void execute(std::string const &args)
virtual void setRunning(bool const r)
virtual void sendError(std::string const &error, std::string const &description)
outputWriter(std::ostream &os)
Outputwriter class will log to debug file, stdout and log file in this order if they have been initia...
std::string const & fn() const
bool attach(std::string const &fn)
void setLevel(int const l)
std::vector< bBoard > positions_t