BenBot 1.7.5
A chess engine
Loading...
Searching...
No Matches
ben_bot::search::Options Struct Referencefinal

#include <libbenbot/search/Options.hpp>

Public Member Functions

auto to_string () const -> std::string

Static Public Member Functions

static auto from_libchess (const chess::uci::GoCommandOptions &goOptions, bool isWhiteToMove, std::chrono::milliseconds overhead=std::chrono::milliseconds { 0 }) -> Options
static auto from_string (std::string_view text, const chess::game::Position &currentPosition) -> Options

Public Attributes

size_t depth { std::numeric_limits<size_t>::max() }
bool infinite { false }
std::optional< size_t > mateIn
size_t maxNodes { std::numeric_limits<size_t>::max() }
std::chrono::milliseconds moveOverhead { 0uz }
chess::moves::MoveList movesToSearch
size_t multiPV { 1uz }
std::optional< std::chrono::milliseconds > searchTime
std::optional< std::chrono::milliseconds > softSearchTime

Detailed Description

This struct encapsulates the parameters to the search algorithm.

See also
Context

Definition at line 58 of file Options.hpp.

Member Function Documentation

◆ from_libchess()

auto ben_bot::search::Options::from_libchess ( const chess::uci::GoCommandOptions & goOptions,
bool isWhiteToMove,
std::chrono::milliseconds overhead = std::chrono::milliseconds { 0 } ) -> Options
staticnodiscard

Translates the raw UCI "go" command options into this struct's fields. The move overhead is subtracted from the time we have available.

◆ from_string()

auto ben_bot::search::Options::from_string ( std::string_view text,
const chess::game::Position & currentPosition ) -> Options
staticnodiscard

Deserializes options from a string.

◆ to_string()

auto ben_bot::search::Options::to_string ( ) const -> std::string
nodiscard

Serializes these options to a string.

Member Data Documentation

◆ depth

size_t ben_bot::search::Options::depth { std::numeric_limits<size_t>::max() }

The maximum search depth (in plies).

Definition at line 60 of file Options.hpp.

◆ infinite

bool ben_bot::search::Options::infinite { false }

If true, the search should not exit until a stop or exit command is received.

Definition at line 86 of file Options.hpp.

◆ mateIn

std::optional<size_t> ben_bot::search::Options::mateIn

Search for mate in this many moves.

Definition at line 89 of file Options.hpp.

◆ maxNodes

size_t ben_bot::search::Options::maxNodes { std::numeric_limits<size_t>::max() }

Search only this many nodes. Setting this value too low can really emphasize the effects of our move ordering algorithm.

Definition at line 76 of file Options.hpp.

◆ moveOverhead

std::chrono::milliseconds ben_bot::search::Options::moveOverhead { 0uz }

Move overhead time subtracted from maximum search time.

Definition at line 71 of file Options.hpp.

◆ movesToSearch

chess::moves::MoveList ben_bot::search::Options::movesToSearch

Restrict the search to only these moves. If this is empty, all legal moves in the position will be searched.

Definition at line 81 of file Options.hpp.

◆ multiPV

size_t ben_bot::search::Options::multiPV { 1uz }

The number of principal variations to search for and report. If this is greater than 1, the search will find the N best lines.

Definition at line 94 of file Options.hpp.

◆ searchTime

std::optional<std::chrono::milliseconds> ben_bot::search::Options::searchTime

The maximum search time. The search is aborted once this much time has passed.

Definition at line 63 of file Options.hpp.

◆ softSearchTime

std::optional<std::chrono::milliseconds> ben_bot::search::Options::softSearchTime

A softer time limit: once this much time has passed, we don't start another iteration, but the current one is allowed to finish (up to searchTime).

Definition at line 68 of file Options.hpp.


The documentation for this struct was generated from the following file: