|
io-chess
UCI chess engine
|
Classical, non-neural evaluation context. More...
#include <SimpleEvalContext.h>


Public Types | |
| using | Score = EvalScore |
Public Member Functions | |
| Score | evalOneSide (const Board &board, Color us, int &phase) const |
| Evaluates features specific to one side. | |
| void | evalPawns (const Board &board, Color us, const Bitboard &ourPawns, const Bitboard &theirPawns, Score &score) const |
| Evaluates pawn structure features. | |
| void | evalKingSafety (const Board &board, Color us, const Bitboard &ourPawns, const Bitboard &theirPawns, Score &score) const |
| Evaluates king safety and pawn shield quality. | |
| SimpleEvalContext ()=default | |
| float | evaluate (const Board &board, int ply=0) override |
| Computes the tapered static evaluation of the board. | |
| Public Member Functions inherited from IEvaluator | |
| virtual | ~IEvaluator ()=default |
| virtual WDLConverter::WDL | evaluateWDL (const Board &board, int ply=0) |
| Evaluates the board and returns Win/Draw/Loss probabilities. | |
| virtual float | evaluate (const ChessInput &input) |
| Evaluates the position using pre-computed features. | |
| virtual void | setAggression (float aggression) |
| Sets the contempt or aggression factor for the evaluator. | |
| virtual void | setEvalScale (int base, int weight) |
| Sets the scaling parameters for the evaluation score. | |
| virtual void | setEvalNormalization (bool enable) |
| Enables or disables dynamic evaluation normalization. | |
| virtual void | setIncrementalRebuildInterval (int interval) |
| Sets the interval for forcing full feature rebuilds (to correct accumulation errors). | |
| virtual uint64_t | getFullRebuilds () const |
| Retrieves the number of full feature rebuilds performed (for profiling). | |
Static Public Member Functions | |
| static int | mirror (int sq) |
| Mirrors a square index vertically (for black's perspective). | |
Static Public Attributes | |
| static constexpr int | PHASE_KNIGHT = 1 |
| static constexpr int | PHASE_BISHOP = 1 |
| static constexpr int | PHASE_ROOK = 2 |
| static constexpr int | PHASE_QUEEN = 4 |
| static constexpr int | TOTAL_PHASE = 24 |
| static constexpr int | TEMPO_BONUS = 15 |
| static const Score | PIECE_VALUES [6] |
| static const Score | PSQT [6][64] |
| static constexpr Score | BISHOP_PAIR = {30, 80} |
| static constexpr Score | ROOK_OPEN_FILE = {35, 15} |
| static constexpr Score | ROOK_SEMI_OPEN = {15, 10} |
| static constexpr Score | PAWN_PASSED [8] |
| static constexpr Score | PAWN_ISOLATED = {-10, -15} |
| static constexpr Score | PAWN_DOUBLED = {-15, -20} |
Classical, non-neural evaluation context.
Implements a traditional evaluation function based on material, PSQT, pawn structure, mobility, and king safety. Useful as a fallback when the neural network is unavailable.
| using SimpleEvalContext::Score = EvalScore |
|
default |
| void SimpleEvalContext::evalKingSafety | ( | const Board & | board, |
| Color | us, | ||
| const Bitboard & | ourPawns, | ||
| const Bitboard & | theirPawns, | ||
| Score & | score ) const |
Evaluates king safety and pawn shield quality.

Evaluates features specific to one side.

| void SimpleEvalContext::evalPawns | ( | const Board & | board, |
| Color | us, | ||
| const Bitboard & | ourPawns, | ||
| const Bitboard & | theirPawns, | ||
| Score & | score ) const |
Evaluates pawn structure features.

|
overridevirtual |
Computes the tapered static evaluation of the board.
| board | The chess board position. |
| ply | Distance from the search root. |
Implements IEvaluator.


|
inlinestatic |
Mirrors a square index vertically (for black's perspective).

|
staticconstexpr |
|
staticconstexpr |
|
staticconstexpr |
|
staticconstexpr |
|
staticconstexpr |
|
staticconstexpr |
|
staticconstexpr |
|
staticconstexpr |
|
static |
|
static |
|
staticconstexpr |
|
staticconstexpr |
|
staticconstexpr |
|
staticconstexpr |