BenBot
1.7.5
A chess engine
Loading...
Searching...
No Matches
Result.hpp
Go to the documentation of this file.
1
/*
2
* ======================================================================================
3
*
4
* ░▒▓███████▓▒░░▒▓████████▓▒░▒▓███████▓▒░ ░▒▓███████▓▒░ ░▒▓██████▓▒░▒▓████████▓▒░
5
* ░▒▓█▓▒░░▒▓█▓▒░▒▓█▓▒░ ░▒▓█▓▒░░▒▓█▓▒░ ░▒▓█▓▒░░▒▓█▓▒░▒▓█▓▒░░▒▓█▓▒░ ░▒▓█▓▒░
6
* ░▒▓█▓▒░░▒▓█▓▒░▒▓█▓▒░ ░▒▓█▓▒░░▒▓█▓▒░ ░▒▓█▓▒░░▒▓█▓▒░▒▓█▓▒░░▒▓█▓▒░ ░▒▓█▓▒░
7
* ░▒▓███████▓▒░░▒▓██████▓▒░ ░▒▓█▓▒░░▒▓█▓▒░ ░▒▓███████▓▒░░▒▓█▓▒░░▒▓█▓▒░ ░▒▓█▓▒░
8
* ░▒▓█▓▒░░▒▓█▓▒░▒▓█▓▒░ ░▒▓█▓▒░░▒▓█▓▒░ ░▒▓█▓▒░░▒▓█▓▒░▒▓█▓▒░░▒▓█▓▒░ ░▒▓█▓▒░
9
* ░▒▓█▓▒░░▒▓█▓▒░▒▓█▓▒░ ░▒▓█▓▒░░▒▓█▓▒░ ░▒▓█▓▒░░▒▓█▓▒░▒▓█▓▒░░▒▓█▓▒░ ░▒▓█▓▒░
10
* ░▒▓███████▓▒░░▒▓████████▓▒░▒▓█▓▒░░▒▓█▓▒░ ░▒▓███████▓▒░ ░▒▓██████▓▒░ ░▒▓█▓▒░
11
*
12
* ======================================================================================
13
*/
14
19
20
#pragma once
21
22
#include <chrono>
23
#include <cstddef>
// IWYU pragma: keep - for size_t;
24
#include <
libbenbot/eval/Score.hpp
>
25
#include <
libchess/moves/Move.hpp
>
26
#include <
libchess/moves/MoveGen.hpp
>
27
#include <optional>
28
29
namespace
chess::uci::printing
{
30
struct
SearchInfo
;
31
}
// namespace chess::uci::printing
32
33
namespace
ben_bot::search
{
34
35
using
chess::moves::Move;
36
using
chess::moves::MoveList
;
37
using
std::chrono::milliseconds;
38
using
std::size_t;
39
44
struct
[[nodiscard]]
Result
final {
49
milliseconds
duration
{ 0uz };
50
54
size_t
depth
{ 0uz };
55
57
size_t
qDepth
{ 0uz };
58
60
eval::Score
score
;
61
63
MoveList
pv
;
64
69
size_t
nodesSearched
{ 0uz };
70
74
size_t
transpositionTableHits
{ 0uz };
75
77
size_t
betaCutoffs
{ 0uz };
78
80
size_t
staticEvals
{ 0uz };
81
83
size_t
mdpCutoffs
{ 0uz };
84
88
size_t
hashfull
{ 0uz };
89
91
[[nodiscard]]
Move
best_move
()
const
{
return
pv
.front(); }
92
94
[[nodiscard]] std::optional<Move>
ponder_move
()
const
95
{
96
if
(
pv
.size() < 2uz)
97
return
std::nullopt;
98
99
return
pv
.at(1uz);
100
}
101
103
using
LibchessResult
=
chess::uci::printing::SearchInfo
;
104
106
[[nodiscard]]
auto
to_libchess
(
bool
includeDebugInfo)
const
->
LibchessResult
;
107
};
108
109
}
// namespace ben_bot::search
MoveGen.hpp
Move.hpp
Score.hpp
ben_bot::search
Definition
TranspositionTable.hpp:42
chess::moves::MoveList
beman::inplace_vector::inplace_vector< Move, MAX_MOVES > MoveList
Definition
MoveGen.hpp:63
chess::uci::printing
Definition
Printing.hpp:34
ben_bot::eval::Score
Definition
Score.hpp:67
ben_bot::search::Result
Definition
Result.hpp:44
ben_bot::search::Result::score
eval::Score score
Definition
Result.hpp:60
ben_bot::search::Result::hashfull
size_t hashfull
Definition
Result.hpp:88
ben_bot::search::Result::to_libchess
auto to_libchess(bool includeDebugInfo) const -> LibchessResult
ben_bot::search::Result::best_move
Move best_move() const
Definition
Result.hpp:91
ben_bot::search::Result::depth
size_t depth
Definition
Result.hpp:54
ben_bot::search::Result::transpositionTableHits
size_t transpositionTableHits
Definition
Result.hpp:74
ben_bot::search::Result::mdpCutoffs
size_t mdpCutoffs
Definition
Result.hpp:83
ben_bot::search::Result::duration
milliseconds duration
Definition
Result.hpp:49
ben_bot::search::Result::staticEvals
size_t staticEvals
Definition
Result.hpp:80
ben_bot::search::Result::qDepth
size_t qDepth
Definition
Result.hpp:57
ben_bot::search::Result::ponder_move
std::optional< Move > ponder_move() const
Definition
Result.hpp:94
ben_bot::search::Result::nodesSearched
size_t nodesSearched
Definition
Result.hpp:69
ben_bot::search::Result::LibchessResult
chess::uci::printing::SearchInfo LibchessResult
Definition
Result.hpp:103
ben_bot::search::Result::pv
MoveList pv
Definition
Result.hpp:63
ben_bot::search::Result::betaCutoffs
size_t betaCutoffs
Definition
Result.hpp:77
chess::moves::Move
Definition
Move.hpp:75
chess::uci::printing::SearchInfo
Definition
Printing.hpp:67
libbenbot
include
libbenbot
search
Result.hpp
Generated on
for BenBot by
1.16.1