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;
27#include <optional>
28
29namespace chess::uci::printing {
30struct SearchInfo;
31} // namespace chess::uci::printing
32
33namespace ben_bot::search {
34
35using chess::moves::Move;
37using std::chrono::milliseconds;
38using std::size_t;
39
44struct [[nodiscard]] Result final {
49 milliseconds duration { 0uz };
50
54 size_t depth { 0uz };
55
57 size_t qDepth { 0uz };
58
61
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
104
106 [[nodiscard]] auto to_libchess(bool includeDebugInfo) const -> LibchessResult;
107};
108
109} // namespace ben_bot::search
beman::inplace_vector::inplace_vector< Move, MAX_MOVES > MoveList
Definition MoveGen.hpp:63
auto to_libchess(bool includeDebugInfo) const -> LibchessResult
Move best_move() const
Definition Result.hpp:91
size_t transpositionTableHits
Definition Result.hpp:74
milliseconds duration
Definition Result.hpp:49
std::optional< Move > ponder_move() const
Definition Result.hpp:94
chess::uci::printing::SearchInfo LibchessResult
Definition Result.hpp:103