Expand description
Static Evaluation Functions.
An evaluation function may have two types of calls: relative or absolute.
An absolute score treats White as a maxing player and Black as a minning player, so a centipawn score of +10 is winning for White, while -10 is winning for Black. A relative score treats the player to move as the maxing player, so if it is Black to move, +10 is winning for Black.
Constants§
- PASS_
PAWN_ PATTERN - PASS_
PAWN_ SIZE - Warning: Do not use, unfinished.
Functions§
- draw
- Return a score representing a stalemate. Uses a contempt factor to indicate how bad a draw is for the engine.
- evaluate
- Primary hand-crafted evaluate function for engine, with return relative to player to move. Statically evaluates a non-terminal position.
- evaluate_
abs - Primary evaluate function for engine. Statically evaluate a non-terminal position using a variety of heuristics.
- king_
safety - material
- Returns relative strength difference of pieces in position. Is equivalent of piece_centipawn(White) - pieces_centipawn(Black). A positive value is an advantage for white, 0 is even, negative is advantage for black.
- mobility
- Return value of number of moves that can be made from a position.
- pass_
pawns - Returns Centipawn difference for passed pawns.
- piece_
square_ lookup - Returns value from looking up each piece square in precalculated tables.
- terminal
- Given a terminal node, return a score representing a checkmate or a draw. The return score is relative to the player to move.
- terminal_
abs - Given a terminal node (no moves can be made), return a score representing a checkmate for white/black, or a draw.
- xray_
king_ attacks - Returns value from sliding pieces attacking opposing king on otherwise empty chessboard.