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;
28#include <optional>
29#include <vector>
30
31namespace chess::notation {
32struct EPDPosition;
33} // namespace chess::notation
34
35namespace chess::uci::printing {
36struct SearchInfo;
37} // namespace chess::uci::printing
38
39namespace ben_bot::search {
40
41using chess::game::Position;
42using chess::moves::Move;
44using std::chrono::milliseconds;
45using std::size_t;
46
51struct [[nodiscard]] Result final {
53 struct Line final {
56
59 };
60
63
68 milliseconds duration { 0uz };
69
73 size_t depth { 0uz };
74
76 size_t qDepth { 0uz };
77
80
83
88 std::vector<Line> otherLines;
89
94 size_t nodesSearched { 0uz };
95
99 size_t transpositionTableHits { 0uz };
100
102 size_t betaCutoffs { 0uz };
103
105 size_t staticEvals { 0uz };
106
108 size_t mdpCutoffs { 0uz };
109
113 size_t hashfull { 0uz };
114
116 [[nodiscard]] auto best_move() const -> Move { return pv.front(); }
117
119 [[nodiscard]] auto ponder_move() const -> std::optional<Move>
120 {
121 if (pv.size() < 2uz)
122 return std::nullopt;
123
124 return pv.at(1uz);
125 }
126
128 [[nodiscard]] auto num_lines() const noexcept -> size_t { return otherLines.size() + 1uz; }
129
132
142 [[nodiscard]] auto to_libchess(bool includeDebugInfo, size_t lineIdx = 0uz) const -> LibchessResult;
143
151};
152
153} // namespace ben_bot::search
NMoveList< MAX_MOVES > MoveList
Definition MoveGen.hpp:72
size_t transpositionTableHits
Definition Result.hpp:99
milliseconds duration
Definition Result.hpp:68
auto to_libchess(bool includeDebugInfo, size_t lineIdx=0uz) const -> LibchessResult
auto num_lines() const noexcept -> size_t
Definition Result.hpp:128
chess::uci::printing::SearchInfo LibchessResult
Definition Result.hpp:131
auto ponder_move() const -> std::optional< Move >
Definition Result.hpp:119
std::vector< Line > otherLines
Definition Result.hpp:88
auto best_move() const -> Move
Definition Result.hpp:116
void fill_standard_epd_operations(chess::notation::EPDPosition &position) const