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 (negative score)
- isolated pawns (negative score)
- chained pawns (positive score)
- passed pawns (positive score)
- open files next to the king (negative score)
- pawn shield next to the king (positive 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.