From 90cc30aef0a66652af0b0a6ec9bd0fd8f3ceef6f Mon Sep 17 00:00:00 2001 From: alwey Date: Sat, 5 Sep 2020 09:23:12 +0200 Subject: [PATCH] Evaluate ungatable pieces in Seirawan --- src/evaluate.cpp | 4 ++++ 1 files changed, 4 insertions(+), 0 deletions(-) diff --git a/src/evaluate.cpp b/src/evaluate.cpp index 5056b79..0f1f0c5 100644 --- a/src/evaluate.cpp +++ b/src/evaluate.cpp @@ -467,6 +467,10 @@ namespace { std::max(PieceValue[EG][pos.promoted_piece_type(pt)] - PieceValue[EG][pt], VALUE_ZERO)) / 4 * pos.count_in_hand(Us, pt); if (pos.enclosing_drop()) mobility[Us] += make_score(500, 500) * popcount(b); + + // Reduce score if there is a deficit of gates + if (pos.seirawan_gating() && !pos.piece_drops() && pos.count_in_hand(Us, ALL_PIECES) > popcount(pos.gates(Us))) + score -= make_score(200, 900) / pos.count_in_hand(Us, ALL_PIECES) * (pos.count_in_hand(Us, ALL_PIECES) - popcount(pos.gates(Us))); } return score; -- 1.7.0.4