Stockfish, a UCI chess playing engine derived from Glaurung 2.1
Copyright (C) 2004-2008 Tord Romstad (Glaurung author)
Copyright (C) 2008-2015 Marco Costalba, Joona Kiiski, Tord Romstad
- Copyright (C) 2015-2017 Marco Costalba, Joona Kiiski, Gary Linscott, Tord Romstad
+ Copyright (C) 2015-2018 Marco Costalba, Joona Kiiski, Gary Linscott, Tord Romstad
Stockfish is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
{ 32, 255, -3 }, // Knight OUR PIECES
{ 0, 104, 4, 0 }, // Bishop
{ -26, -2, 47, 105, -149 }, // Rook
- {-185, 24, 122, 137, -134, 0 } // Queen
+ {-189, 24, 117, 133, -134, -10 } // Queen
};
const int QuadraticTheirs[][PIECE_TYPE_NB] = {
{ 9, 63, 0 }, // Knight OUR PIECES
{ 59, 65, 42, 0 }, // Bishop
{ 46, 39, 24, -24, 0 }, // Rook
- { 101, 100, -37, 141, 268, 0 } // Queen
- };
-
- // PawnSet[pawn count] contains a bonus/malus indexed by number of pawns
- const int PawnSet[] = {
- 24, -32, 107, -51, 117, -9, -126, -21, 31
- };
-
- // QueenMinorsImbalance[opp_minor_count] is applied when only one side has a queen.
- // It contains a bonus/malus for the side with the queen.
- const int QueenMinorsImbalance[13] = {
- 31, -8, -15, -25, -5
+ { 97, 100, -42, 137, 268, 0 } // Queen
};
// Endgame evaluation and scaling functions are accessed directly and not through
const Color Them = (Us == WHITE ? BLACK : WHITE);
- int bonus = PawnSet[pieceCount[Us][PAWN]];
+ int bonus = 0;
- // Second-degree polynomial material imbalance by Tord Romstad
+ // Second-degree polynomial material imbalance, by Tord Romstad
for (int pt1 = NO_PIECE_TYPE; pt1 <= QUEEN; ++pt1)
{
if (!pieceCount[Us][pt1])
bonus += pieceCount[Us][pt1] * v;
}
- // Special handling of Queen vs. Minors
- if (pieceCount[Us][QUEEN] == 1 && pieceCount[Them][QUEEN] == 0)
- bonus += QueenMinorsImbalance[pieceCount[Them][KNIGHT] + pieceCount[Them][BISHOP]];
-
return bonus;
}