Function inanis::evaluation::pawns::evaluate

source ·
pub fn evaluate(
    board: &Board,
    phtable: &PHTable,
    stats: &mut SearchStats
) -> PackedEval
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
  • isolated pawns
  • chained pawns
  • passed pawns
  • backward pawns
  • open files next to the king
  • pawn shield next to the king

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.