]> git.sesse.net Git - stockfish/blobdiff - src/material.cpp
Tweak again futility margings
[stockfish] / src / material.cpp
index 11fd3c9b235cfe5ba8baaa542694186f69a6aa9a..44700f815d8017a9f2539c3d64f4731b3028d3f6 100644 (file)
@@ -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;