mirror of
https://github.com/HChaZZY/Stockfish.git
synced 2025-12-17 23:56:23 +08:00
Merge space weigth evaluation fromGlaurung 2.2
Is a new evaluation rule that gives bonus in midgame to the side that has more space behind pawns for its minor pieces. Signed-off-by: Marco Costalba <mcostalba@gmail.com>
This commit is contained in:
@@ -237,6 +237,18 @@ MaterialInfo* MaterialInfoTable::get_material_info(const Position& pos) {
|
||||
}
|
||||
}
|
||||
|
||||
// Compute the space weight
|
||||
if (pos.non_pawn_material(WHITE) + pos.non_pawn_material(BLACK) >=
|
||||
2*QueenValueMidgame + 4*RookValueMidgame + 2*KnightValueMidgame)
|
||||
{
|
||||
int minorPieceCount = pos.piece_count(WHITE, KNIGHT)
|
||||
+ pos.piece_count(BLACK, KNIGHT)
|
||||
+ pos.piece_count(WHITE, BISHOP)
|
||||
+ pos.piece_count(BLACK, BISHOP);
|
||||
|
||||
mi->spaceWeight = minorPieceCount * minorPieceCount;
|
||||
}
|
||||
|
||||
// Evaluate the material balance
|
||||
|
||||
int sign;
|
||||
|
||||
Reference in New Issue
Block a user