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

#include <libbenbot/search/Result.hpp>

Collaboration diagram for ben_bot::search::Result:

Classes

struct  Line

Public Types

using LibchessResult = chess::uci::printing::SearchInfo

Public Member Functions

auto best_move () const -> Move
void fill_standard_epd_operations (chess::notation::EPDPosition &position) const
auto num_lines () const noexcept -> size_t
auto ponder_move () const -> std::optional< Move >
auto to_libchess (bool includeDebugInfo, size_t lineIdx=0uz) const -> LibchessResult

Public Attributes

size_t betaCutoffs { 0uz }
size_t depth { 0uz }
milliseconds duration { 0uz }
size_t hashfull { 0uz }
size_t mdpCutoffs { 0uz }
size_t nodesSearched { 0uz }
std::vector< Line > otherLines
Position position
MoveList pv
size_t qDepth { 0uz }
eval::Score score
size_t staticEvals { 0uz }
size_t transpositionTableHits { 0uz }

Detailed Description

The results from a completed search. This struct can also represent a still-in-progress search (ie, an update on each iterative deepening iteration).

Definition at line 51 of file Result.hpp.

Member Typedef Documentation

◆ LibchessResult

Typedef for the libchess type used for printing UCI-formatted output.

Definition at line 131 of file Result.hpp.

Member Function Documentation

◆ best_move()

auto ben_bot::search::Result::best_move ( ) const -> Move
inlinenodiscard

Returns the best move found by this search.

Definition at line 116 of file Result.hpp.

◆ fill_standard_epd_operations()

void ben_bot::search::Result::fill_standard_epd_operations ( chess::notation::EPDPosition & position) const

Fills the EPD position's operations with the search results and statistics from this result. All standard EPD operations that contain search-related statistics and information that correspond to fields of this structure are filled in or updated.

◆ num_lines()

auto ben_bot::search::Result::num_lines ( ) const -> size_t
inlinenodiscardnoexcept

Returns the total number of lines in this result, including the principal variation.

Definition at line 128 of file Result.hpp.

◆ ponder_move()

auto ben_bot::search::Result::ponder_move ( ) const -> std::optional< Move >
inlinenodiscard

Returns the ponder move found by this search, if one exists.

Definition at line 119 of file Result.hpp.

◆ to_libchess()

auto ben_bot::search::Result::to_libchess ( bool includeDebugInfo,
size_t lineIdx = 0uz ) const -> LibchessResult
nodiscard

Converts this object to the libchess type used for printing UCI-formatted output.

Parameters
includeDebugInfoIf true, extra search statistics are included in the output.
lineIdxThe index of the line to convert. Index 0 is the principal variation, and indices greater than 0 refer to otherLines. In MultiPV mode, the output's multiPV field is set to the 1-based line number.
See also
num_lines()

Member Data Documentation

◆ betaCutoffs

size_t ben_bot::search::Result::betaCutoffs { 0uz }

Number of cutoffs due to alpha-beta.

Definition at line 102 of file Result.hpp.

◆ depth

size_t ben_bot::search::Result::depth { 0uz }

The total depth that was searched. This value is the highest depth that was completed.

Definition at line 73 of file Result.hpp.

◆ duration

milliseconds ben_bot::search::Result::duration { 0uz }

The total amount of time spent searching to produce this result. For depths greater than 1, this value is the duration of the entire search, including lower depths of the iterative deepening loop.

Definition at line 68 of file Result.hpp.

◆ hashfull

size_t ben_bot::search::Result::hashfull { 0uz }

The approximate fraction of transposition table entries (permille) that were written to during this root search.

Definition at line 113 of file Result.hpp.

◆ mdpCutoffs

size_t ben_bot::search::Result::mdpCutoffs { 0uz }

Number of cutoffs due to mate distance pruning.

Definition at line 108 of file Result.hpp.

◆ nodesSearched

size_t ben_bot::search::Result::nodesSearched { 0uz }

The total number of nodes visited during this search. For depths greater than 1, this value includes nodes visited in shallower depths of the iterative deepening loop.

Definition at line 94 of file Result.hpp.

◆ otherLines

std::vector<Line> ben_bot::search::Result::otherLines

In MultiPV mode, the additional lines found by the search, ordered from best to worst. These do not include the principal variation, which is always stored in score and pv. This is empty when not in MultiPV mode.

Definition at line 88 of file Result.hpp.

◆ position

Position ben_bot::search::Result::position

The root position that was searched.

Definition at line 62 of file Result.hpp.

◆ pv

MoveList ben_bot::search::Result::pv

The principal variation found during the search.

Definition at line 82 of file Result.hpp.

◆ qDepth

size_t ben_bot::search::Result::qDepth { 0uz }

The deepest depth reached by the quiescence search.

Definition at line 76 of file Result.hpp.

◆ score

eval::Score ben_bot::search::Result::score

The evaluation of the position resulting from playing the best move.

Definition at line 79 of file Result.hpp.

◆ staticEvals

size_t ben_bot::search::Result::staticEvals { 0uz }

The total number of static evaluations performed during the search.

Definition at line 105 of file Result.hpp.

◆ transpositionTableHits

size_t ben_bot::search::Result::transpositionTableHits { 0uz }

The number of nodes for which a saved score from the transposition table could be used.

Definition at line 99 of file Result.hpp.


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