Permalink
Browse files

Piece mobility: filter out squares protected by pawns

Do not consider squares protected by enemy pawns
in mobility evaluation.

This reduces the mobility value by about 15%

Signed-off-by: Marco Costalba <mcostalba@gmail.com>
  • Loading branch information...
1 parent dc4e2d8 commit d0804341c5ec422c19e34db20756d123d03464e0 @mcostalba committed Jan 5, 2009
Showing with 4 additions and 1 deletion.
  1. +4 −1 src/evaluate.cpp
View
@@ -575,8 +575,11 @@ namespace {
ei.kingAdjacentZoneAttacksCount[us] += count_1s_max_15(bb);
}
+ // Remove squares protected by enemy pawns
+ Bitboard bb = (b & ~ei.attackedBy[them][PAWN]);
+
// Mobility
- int mob = count_1s_max_15(b & ~p.pieces_of_color(us));
+ int mob = count_1s_max_15(bb & ~p.pieces_of_color(us));
ei.mgMobility += Sign[us] * mgBonus[mob];
ei.egMobility += Sign[us] * egBonus[mob];

0 comments on commit d080434

Please sign in to comment.