Function inanis::evaluation::pawns::evaluate

source ·
pub fn evaluate<const DIAG: bool>(
    board: &Board,
    pawn_hashtable: &PawnHashTable,
    statistics: &mut SearchStatistics
) -> i16
Expand description

Evaluates structure of pawns on the board and returns score from the white color perspective (more than 0 when advantage, less than 0 when disadvantage). This evaluator considers:

  • doubled pawns (negative score)
  • isolated pawns (negative score)
  • chained pawns (positive score)
  • passed pawns (positive score)
  • open files next to the king (negative score)

To improve performance (using the fact that structure of pawns changes relatively rare), each evaluation is saved in the pawn hashtable, and used again if possible.