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

#include <libbenbot/data-structures/HistoryTable.hpp>

Public Member Functions

void age () noexcept
void clear () noexcept
auto get (const bool whiteToMove, const Move move) const noexcept -> int
void update (const bool whiteToMove, const Move move, const int bonus) noexcept

Static Public Attributes

static constexpr auto MAX_SCORE { 16384 }

Detailed Description

This structure stores history heuristic scores for quiet moves. Scores are indexed by side to move and the move's from & to squares. Moves that cause beta cutoffs get a bonus, and the quiet moves that were searched before them get a penalty.

Definition at line 38 of file HistoryTable.hpp.

Member Function Documentation

◆ age()

void ben_bot::HistoryTable::age ( )
inlinenoexcept

Halves all the stored scores. This is called at the start of each search, so that scores from previous searches still count, but less than new ones.

Definition at line 49 of file HistoryTable.hpp.

◆ clear()

void ben_bot::HistoryTable::clear ( )
inlinenoexcept

Clears all the stored scores.

Definition at line 43 of file HistoryTable.hpp.

◆ get()

auto ben_bot::HistoryTable::get ( const bool whiteToMove,
const Move move ) const -> int
inlinenodiscardnoexcept

Returns the score for the given move.

Definition at line 66 of file HistoryTable.hpp.

◆ update()

void ben_bot::HistoryTable::update ( const bool whiteToMove,
const Move move,
const int bonus )
inlinenoexcept

Applies a bonus (or penalty, if negative) to the given move's score. This uses the "history gravity" formula, which keeps scores within [-MAX_SCORE, MAX_SCORE].

Definition at line 60 of file HistoryTable.hpp.

Member Data Documentation

◆ MAX_SCORE

auto ben_bot::HistoryTable::MAX_SCORE { 16384 }
staticconstexpr

The maximum absolute value of any score in the table.

Definition at line 40 of file HistoryTable.hpp.


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