BenBot 1.7.5
A chess engine
Loading...
Searching...
No Matches
Printing.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 <cstdint>
27#include <optional>
28#include <span>
29#include <string>
30#include <string_view>
31#include <variant>
32
37
38using moves::Move;
39using std::size_t;
40
50std::monostate info_string(std::string_view info);
51
58 Move bestMove,
59 std::optional<Move> ponderMove);
60
68 Move currentMove, size_t moveNum);
69
76 Move move,
77 std::span<const Move> refutation = { });
78
85 std::span<const Move> line,
86 std::optional<size_t> cpuNum = std::nullopt);
87
94struct SearchInfo final {
96 struct Score {
98 struct Centipawns final {
100 int value { 0 };
101 };
102
104 struct MateIn final {
108 int plies { 0 };
109
113 [[nodiscard]] auto moves() const noexcept -> int;
114 };
115
117 std::variant<Centipawns, MateIn> value;
118
120 bool lowerBound { false };
121
123 bool upperBound { false };
124
126 enum class Type : std::uint_least8_t {
130 };
131
133 [[nodiscard]] auto get_type() const noexcept -> Type;
134 };
135
138
140 size_t depth { 0uz };
141
143 size_t selDepth { 0uz };
144
146 std::chrono::milliseconds time;
147
149 size_t nodes { 0uz };
150
154 std::optional<size_t> multiPV;
155
158
160 size_t hashfull { 0uz };
161
163 size_t tbHits { 0uz };
164
168 std::string extraInformation;
169
171 [[nodiscard]] auto get_nps() const noexcept -> size_t;
172};
173
179void search_info(const SearchInfo& info);
180
181} // namespace chess::uci::printing
NMoveList< MAX_MOVES > MoveList
Definition MoveGen.hpp:72
void best_move(Move bestMove, std::optional< Move > ponderMove)
void refutation_info(Move move, std::span< const Move > refutation={ })
void search_info(const SearchInfo &info)
void currmove_info(Move currentMove, size_t moveNum)
std::monostate info_string(std::string_view info)
void currline_info(std::span< const Move > line, std::optional< size_t > cpuNum=std::nullopt)
auto get_type() const noexcept -> Type
std::variant< Centipawns, MateIn > value
Definition Printing.hpp:117
std::optional< size_t > multiPV
Definition Printing.hpp:154
auto get_nps() const noexcept -> size_t
std::chrono::milliseconds time
Definition Printing.hpp:146