Piece mobility: filter out squares protected by pawns
authorMarco Costalba <mcostalba@gmail.com>
Mon, 5 Jan 2009 14:14:16 +0000 (15:14 +0100)
committerMarco Costalba <mcostalba@gmail.com>
Mon, 5 Jan 2009 14:14:16 +0000 (15:14 +0100)
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>
src/evaluate.cpp

index 12329fcdceef82a7872aa2f43af3c8dfd1344e2f..d261f4489f164802b52009f8faab5c8e43354ecb 100644 (file)
@@ -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];