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

#include <libbenbot/search/Bounds.hpp>

Collaboration diagram for ben_bot::search::Bounds:

Public Member Functions

constexpr auto contains (Score score) const noexcept -> bool
constexpr auto invert () const noexcept -> Bounds
constexpr auto mate_distance_pruning (size_t plyFromRoot) noexcept -> std::optional< Score >
constexpr auto null_window () const noexcept -> Bounds

Public Attributes

Score alpha { -eval::MAX }
Score beta { eval::MAX }

Detailed Description

This struct encapsulates a search's alpha and beta bounds values. This struct is mostly for internal usage by the search context class.

Definition at line 36 of file Bounds.hpp.

Member Function Documentation

◆ contains()

auto ben_bot::search::Bounds::contains ( Score score) const -> bool
nodiscardconstexprnoexcept

Returns true if the score is between alpha and beta.

Definition at line 97 of file Bounds.hpp.

◆ invert()

auto ben_bot::search::Bounds::invert ( ) const -> Bounds
nodiscardconstexprnoexcept

Returns an inverted copy of these bounds, suitable for swapping the player perspectives.

Definition at line 81 of file Bounds.hpp.

◆ mate_distance_pruning()

auto ben_bot::search::Bounds::mate_distance_pruning ( size_t plyFromRoot) -> std::optional< Score >
nodiscardconstexprnoexcept

Performs mate distance pruning. If an MDP cutoff is available, returns the cutoff value (and the search may return early). If no MDP cutoff is available, this method returns nullopt and the search should continue.

Definition at line 102 of file Bounds.hpp.

◆ null_window()

auto ben_bot::search::Bounds::null_window ( ) const -> Bounds
nodiscardconstexprnoexcept

Returns a null window around alpha. For usage with principal variation search.

Definition at line 89 of file Bounds.hpp.

Member Data Documentation

◆ alpha

Score ben_bot::search::Bounds::alpha { -eval::MAX }

The search's alpha bound.

Definition at line 38 of file Bounds.hpp.

◆ beta

Score ben_bot::search::Bounds::beta { eval::MAX }

The search's beta bound.

Definition at line 41 of file Bounds.hpp.


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