From 33b67edd41bb659a8c250bbc9b93ee49ef5d30ed Mon Sep 17 00:00:00 2001 From: Fabian Fichter Date: Mon, 30 Mar 2020 22:28:52 +0200 Subject: [PATCH] Evaluate extinction threats extinction STC LLR: 2.97 (-2.94,2.94) [0.00,10.00] Total: 197 W: 144 L: 44 D: 9 http://www.variantfishtest.org:6543/tests/view/5e8256cc6e23db4f73614af2 extinction LTC LLR: 2.97 (-2.94,2.94) [0.00,10.00] Total: 158 W: 122 L: 26 D: 10 http://www.variantfishtest.org:6543/tests/view/5e825e4c6e23db4f73614afe kinglet STC LLR: 2.95 (-2.94,2.94) [0.00,10.00] Total: 402 W: 232 L: 133 D: 37 http://www.variantfishtest.org:6543/tests/view/5e8257536e23db4f73614af5 kinglet LTC LLR: 2.95 (-2.94,2.94) [0.00,10.00] Total: 248 W: 159 L: 64 D: 25 http://www.variantfishtest.org:6543/tests/view/5e8267036e23db4f73614b0a threekings STC LLR: 2.97 (-2.94,2.94) [0.00,10.00] Total: 459 W: 117 L: 51 D: 291 http://www.variantfishtest.org:6543/tests/view/5e82576b6e23db4f73614af7 threekings LTC LLR: 2.96 (-2.94,2.94) [0.00,10.00] Total: 366 W: 93 L: 30 D: 243 http://www.variantfishtest.org:6543/tests/view/5e82670e6e23db4f73614b0c --- src/evaluate.cpp | 12 ++++++++++++ 1 files changed, 12 insertions(+), 0 deletions(-) diff --git a/src/evaluate.cpp b/src/evaluate.cpp index d6e5078..fecfc03 100644 --- a/src/evaluate.cpp +++ b/src/evaluate.cpp @@ -636,6 +636,18 @@ namespace { score += make_score(200, 220) * popcount(attackedBy[Them][ALL_PIECES] & moves & ~pos.pieces() & ~attackedBy2[Us]); } + // Extinction threats + if (pos.extinction_value() == -VALUE_MATE) + { + Bitboard bExt = attackedBy[Us][ALL_PIECES] & pos.pieces(Them); + while (bExt) + { + PieceType pt = type_of(pos.piece_on(pop_lsb(&bExt))); + if (pos.extinction_piece_types().find(pt) != pos.extinction_piece_types().end()) + score += make_score(300, 300) / std::max(pos.count_with_hand(Them, pt) - pos.extinction_piece_count(), 1); + } + } + // Non-pawn enemies nonPawnEnemies = pos.pieces(Them) & ~pos.pieces(PAWN, SHOGI_PAWN) & ~pos.pieces(SOLDIER); -- 1.7.0.4