|
BenBot 1.7.5
A chess engine
|
#include <libbenbot/eval/Trace.hpp>
Public Member Functions | |
| constexpr void | add (const Term term, const Color side, const int count, const size_t index=0uz) noexcept |
| constexpr void | add_base (const Color side, const TaperedScore &part) noexcept |
| constexpr auto | coefficient (const size_t index) const noexcept -> int |
| constexpr auto | score (const Weights &weights) const noexcept -> Score |
| constexpr auto | white_score (const Weights &weights) const noexcept -> TaperedScore |
Public Attributes | |
| TaperedScore | base { } |
| std::array< std::array< std::int16_t, 2uz >, NUM_WEIGHTS > | coeffs { } |
| std::int32_t | phase { MAX_PHASE } |
| Color | sideToMove { Color::White } |
Static Public Attributes | |
| static constexpr bool | ENABLED = true |
A tracer that records, for each eval weight, how many times it applied for each side.
The eval is then score(DEFAULT_WEIGHTS): the sum of each weight times its White coefficient minus its Black coefficient, plus base, blended by phase and negated if Black is to move. A tuner can call score() with other weights.
|
inlineconstexprnoexcept |
|
inlinenodiscardconstexprnoexcept |
Returns the White coefficient minus the Black coefficient of the weight at index in Weights::values.
|
inlinenodiscardconstexprnoexcept |
Rebuilds the eval from the given weights, from the side to move's point of view. With DEFAULT_WEIGHTS, this is exactly what evaluate() returns.
|
inlinenodiscardconstexprnoexcept |
| TaperedScore ben_bot::eval::CoeffTracer::base { } |
The parts of the eval that aren't traced by weight, from White's point of view. These are the endgame conversion helpers (the mop-up & last piece terms), which aren't tunable and only apply behind gates on the fixed piece_values.
| std::array<std::array<std::int16_t, 2uz>, NUM_WEIGHTS> ben_bot::eval::CoeffTracer::coeffs { } |
The number of times each weight applied for each side, indexed by [weight][Color]. The weights are in the order of Weights::values. These can be negative, for terms such as space that count our squares minus theirs.
|
staticconstexpr |
| std::int32_t ben_bot::eval::CoeffTracer::phase { MAX_PHASE } |
| Color ben_bot::eval::CoeffTracer::sideToMove { Color::White } |