}
// Let's look if we have a specialized evaluation function for this
- // particular material configuration.
+ // particular material configuration. First we look for a fixed
+ // configuration one, then a generic one if previous search failed.
if ((mi->evaluationFunction = funcs->getEEF(key)) != NULL)
return mi;
}
}
+ // 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;
/// EndgameFunctions member definitions. This class is used to store the maps
-/// of end game and scaling functions that MaterialInfoTable will query for
+/// of end game and scaling functions that MaterialInfoTable will query for
/// each key. The maps are constant and are populated only at construction,
/// but are per-thread instead of globals to avoid expensive locks.