io-chess
UCI chess engine
Loading...
Searching...
No Matches
IEvaluator Class Referenceabstract

Abstract interface for evaluators. More...

#include <IEvaluator.h>

Inheritance diagram for IEvaluator:

Public Member Functions

virtual ~IEvaluator ()=default
virtual float evaluate (const Board &board, int ply=0)=0
 Evaluates the board from the perspective of the side to move.
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).

Detailed Description

Abstract interface for evaluators.

Implementations of this interface are responsible for providing static evaluations of chess positions, translating them into centipawn scores or Win/Draw/Loss probabilities.

Constructor & Destructor Documentation

◆ ~IEvaluator()

virtual IEvaluator::~IEvaluator ( )
virtualdefault

Member Function Documentation

◆ evaluate() [1/2]

virtual float IEvaluator::evaluate ( const Board & board,
int ply = 0 )
pure virtual

Evaluates the board from the perspective of the side to move.

Parameters
boardThe current chess board state.
plyThe current depth from the root of the search (used for scaling).
Returns
Evaluation score in centipawns (e.g., 150 = +1.5 pawns advantage).

Implemented in BatchEvalContext, EvalContextMoECache, and SimpleEvalContext.

Here is the caller graph for this function:

◆ evaluate() [2/2]

virtual float IEvaluator::evaluate ( const ChessInput & input)
inlinevirtual

Evaluates the position using pre-computed features.

This is an optional optimization path for evaluators that utilize incremental feature extraction (like MoE neural networks).

Parameters
inputThe pre-extracted neural network features.
Returns
Evaluation score in centipawns.

Reimplemented in BatchEvalContext.

◆ evaluateWDL()

virtual WDLConverter::WDL IEvaluator::evaluateWDL ( const Board & board,
int ply = 0 )
inlinevirtual

Evaluates the board and returns Win/Draw/Loss probabilities.

Parameters
boardThe current chess board state.
plyThe current depth from the root of the search.
Returns
WDL probability distribution.

Reimplemented in EvalContextMoECache.

◆ getFullRebuilds()

virtual uint64_t IEvaluator::getFullRebuilds ( ) const
inlinevirtual

Retrieves the number of full feature rebuilds performed (for profiling).

Returns
The number of full rebuilds.

Reimplemented in EvalContextMoECache.

◆ setAggression()

virtual void IEvaluator::setAggression ( float aggression)
inlinevirtual

Sets the contempt or aggression factor for the evaluator.

Parameters
aggressionThe aggression factor (positive encourages risk, negative encourages draws).

Reimplemented in EvalContextMoECache.

◆ setEvalNormalization()

virtual void IEvaluator::setEvalNormalization ( bool enable)
inlinevirtual

Enables or disables dynamic evaluation normalization.

Parameters
enableTrue to enable normalization, false to use raw scores.

Reimplemented in EvalContextMoECache.

◆ setEvalScale()

virtual void IEvaluator::setEvalScale ( int base,
int weight )
inlinevirtual

Sets the scaling parameters for the evaluation score.

Parameters
baseThe base scaling divisor.
weightThe material weight scaling factor.

Reimplemented in EvalContextMoECache.

◆ setIncrementalRebuildInterval()

virtual void IEvaluator::setIncrementalRebuildInterval ( int interval)
inlinevirtual

Sets the interval for forcing full feature rebuilds (to correct accumulation errors).

Parameters
intervalThe number of incremental updates before forcing a rebuild.

Reimplemented in EvalContextMoECache.


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