X-Git-Url: https://git.sesse.net/?p=stockfish;a=blobdiff_plain;f=src%2Fmaterial.cpp;h=c1247b6348ff5069a9dfcc42282a14bf64d37970;hp=189179ee41068a1e6afcb7a5f5c09ea43bf8a819;hb=d54e8a59551a7ebcbf2c2155dce46c7386b1742a;hpb=c5ec94d0f1b128fc2c691c7231663a345409d5cc diff --git a/src/material.cpp b/src/material.cpp index 189179ee..c1247b63 100644 --- a/src/material.cpp +++ b/src/material.cpp @@ -35,18 +35,32 @@ namespace { const int NoPawnsSF[4] = { 6, 12, 32 }; // Polynomial material balance parameters - const Value RedundantQueenPenalty = Value(320); - const Value RedundantRookPenalty = Value(554); + const Value RedundantQueen = Value(320); + const Value RedundantRook = Value(554); - const int LinearCoefficients[6] = { 1617, -162, -1172, -190, 105, 26 }; + // pair pawn knight bishop rook queen + const int LinearCoefficients[6] = { 1617, -162, -1172, -190, 105, 26 }; const int QuadraticCoefficientsSameColor[][PIECE_TYPE_NB] = { - { 7, 7, 7, 7, 7, 7 }, { 39, 2, 7, 7, 7, 7 }, { 35, 271, -4, 7, 7, 7 }, - { 7, 25, 4, 7, 7, 7 }, { -27, -2, 46, 100, 56, 7 }, { 58, 29, 83, 148, -3, -25 } }; + // pair pawn knight bishop rook queen + { 7 }, // Bishop pair + { 39, 2 }, // Pawn + { 35, 271, -4 }, // Knight + { 7, 105, 4, 7 }, // Bishop + { -27, -2, 46, 100, 56 }, // Rook + { 58, 29, 83, 148, -3, -25 } // Queen + }; const int QuadraticCoefficientsOppositeColor[][PIECE_TYPE_NB] = { - { 41, 41, 41, 41, 41, 41 }, { 37, 41, 41, 41, 41, 41 }, { 10, 62, 41, 41, 41, 41 }, - { 57, 64, 39, 41, 41, 41 }, { 50, 40, 23, -22, 41, 41 }, { 106, 101, 3, 151, 171, 41 } }; + // THEIR PIECES + // pair pawn knight bishop rook queen + { 41 }, // Bishop pair + { 37, 41 }, // Pawn + { 10, 62, 41 }, // Knight OUR PIECES + { 57, 64, 39, 41 }, // Bishop + { 50, 40, 23, -22, 41 }, // Rook + { 106, 101, 3, 151, 171, 41 } // Queen + }; // Endgame evaluation and scaling functions accessed direcly and not through // the function maps because correspond to more then one material hash key. @@ -95,8 +109,8 @@ namespace { // Redundancy of major pieces, formula based on Kaufman's paper // "The Evaluation of Material Imbalances in Chess" if (pieceCount[Us][ROOK] > 0) - value -= RedundantRookPenalty * (pieceCount[Us][ROOK] - 1) - + RedundantQueenPenalty * pieceCount[Us][QUEEN]; + value -= RedundantRook * (pieceCount[Us][ROOK] - 1) + + RedundantQueen * pieceCount[Us][QUEEN]; // Second-degree polynomial material imbalance by Tord Romstad for (pt1 = NO_PIECE_TYPE; pt1 <= QUEEN; pt1++)