From aa5da8012222bd96add0e1229b3397db0aa9bae1 Mon Sep 17 00:00:00 2001 From: Fabian Fichter Date: Sat, 30 Mar 2019 13:46:12 +0100 Subject: [PATCH] Tweak quadratic bonus for antichess giveaway STC LLR: 2.97 (-2.94,2.94) [0.00,10.00] Total: 3128 W: 1311 L: 1182 D: 635 http://35.161.250.236:6543/tests/view/5c9d2d226e23db76ed25265a giveaway LTC LLR: 2.97 (-2.94,2.94) [0.00,10.00] Total: 2882 W: 1168 L: 1045 D: 669 http://35.161.250.236:6543/tests/view/5c9dd5136e23db76ed25265f --- src/material.cpp | 6 +++--- 1 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/material.cpp b/src/material.cpp index 02122b2..7d11e7e 100644 --- a/src/material.cpp +++ b/src/material.cpp @@ -94,7 +94,7 @@ namespace { /// imbalance() calculates the imbalance by comparing the piece count of each /// piece type for both colors. template - int imbalance(const int pieceCount[][PIECE_TYPE_NB]) { + int imbalance(const Position& pos, const int pieceCount[][PIECE_TYPE_NB]) { constexpr Color Them = (Us == WHITE ? BLACK : WHITE); @@ -103,7 +103,7 @@ namespace { // Second-degree polynomial material imbalance, by Tord Romstad for (int pt1 = NO_PIECE_TYPE; pt1 <= QUEEN; ++pt1) { - if (!pieceCount[Us][pt1]) + if (!pieceCount[Us][pt1] || (pos.extinction_value() == VALUE_MATE && pt1 != KNIGHT)) continue; int v = 0; @@ -247,7 +247,7 @@ Entry* probe(const Position& pos) { { pos.count(BLACK) > 1, pos.count(BLACK), pos.count(BLACK), pos.count(BLACK) , pos.count(BLACK), pos.count(BLACK) } }; - e->value = int16_t((imbalance(pieceCount) - imbalance(pieceCount)) / 16); + e->value = int16_t((imbalance(pos, pieceCount) - imbalance(pos, pieceCount)) / 16); return e; } -- 1.7.0.4