BenBot 1.7.5
A chess engine
Loading...
Searching...
No Matches
Options.hpp
Go to the documentation of this file.
1/*
2 * ======================================================================================
3 *
4 * ░▒▓███████▓▒░░▒▓████████▓▒░▒▓███████▓▒░ ░▒▓███████▓▒░ ░▒▓██████▓▒░▒▓████████▓▒░
5 * ░▒▓█▓▒░░▒▓█▓▒░▒▓█▓▒░ ░▒▓█▓▒░░▒▓█▓▒░ ░▒▓█▓▒░░▒▓█▓▒░▒▓█▓▒░░▒▓█▓▒░ ░▒▓█▓▒░
6 * ░▒▓█▓▒░░▒▓█▓▒░▒▓█▓▒░ ░▒▓█▓▒░░▒▓█▓▒░ ░▒▓█▓▒░░▒▓█▓▒░▒▓█▓▒░░▒▓█▓▒░ ░▒▓█▓▒░
7 * ░▒▓███████▓▒░░▒▓██████▓▒░ ░▒▓█▓▒░░▒▓█▓▒░ ░▒▓███████▓▒░░▒▓█▓▒░░▒▓█▓▒░ ░▒▓█▓▒░
8 * ░▒▓█▓▒░░▒▓█▓▒░▒▓█▓▒░ ░▒▓█▓▒░░▒▓█▓▒░ ░▒▓█▓▒░░▒▓█▓▒░▒▓█▓▒░░▒▓█▓▒░ ░▒▓█▓▒░
9 * ░▒▓█▓▒░░▒▓█▓▒░▒▓█▓▒░ ░▒▓█▓▒░░▒▓█▓▒░ ░▒▓█▓▒░░▒▓█▓▒░▒▓█▓▒░░▒▓█▓▒░ ░▒▓█▓▒░
10 * ░▒▓███████▓▒░░▒▓████████▓▒░▒▓█▓▒░░▒▓█▓▒░ ░▒▓███████▓▒░ ░▒▓██████▓▒░ ░▒▓█▓▒░
11 *
12 * ======================================================================================
13 */
14
20
25
26#pragma once
27
28#include <chrono>
29#include <cstddef> // IWYU pragma: keep - for size_t
31#include <limits>
32#include <optional>
33#include <string>
34#include <string_view>
35
36namespace chess::uci {
37struct GoCommandOptions;
38} // namespace chess::uci
39
40namespace chess::game {
41struct Position;
42} // namespace chess::game
43
49namespace ben_bot::search {
50
51using std::size_t;
52
58struct Options final {
60 size_t depth { std::numeric_limits<size_t>::max() };
61
63 std::optional<std::chrono::milliseconds> searchTime;
64
68 std::optional<std::chrono::milliseconds> softSearchTime;
69
71 std::chrono::milliseconds moveOverhead { 0uz };
72
76 size_t maxNodes { std::numeric_limits<size_t>::max() };
77
82
86 bool infinite { false };
87
89 std::optional<size_t> mateIn;
90
94 size_t multiPV { 1uz };
95
97 [[nodiscard]] auto to_string() const -> std::string;
98
100 [[nodiscard]] static auto from_string(
101 std::string_view text,
102 const chess::game::Position& currentPosition) -> Options;
103
107 [[nodiscard]] static auto from_libchess(
108 const chess::uci::GoCommandOptions& goOptions,
109 bool isWhiteToMove,
110 std::chrono::milliseconds overhead = std::chrono::milliseconds { 0 }) -> Options;
111};
112
113} // namespace ben_bot::search
NMoveList< MAX_MOVES > MoveList
Definition MoveGen.hpp:72
std::chrono::milliseconds moveOverhead
Definition Options.hpp:71
static auto from_string(std::string_view text, const chess::game::Position &currentPosition) -> Options
auto to_string() const -> std::string
std::optional< std::chrono::milliseconds > searchTime
Definition Options.hpp:63
chess::moves::MoveList movesToSearch
Definition Options.hpp:81
std::optional< size_t > mateIn
Definition Options.hpp:89
static auto from_libchess(const chess::uci::GoCommandOptions &goOptions, bool isWhiteToMove, std::chrono::milliseconds overhead=std::chrono::milliseconds { 0 }) -> Options
std::optional< std::chrono::milliseconds > softSearchTime
Definition Options.hpp:68