Penalty for mandatory demotions
authorFabian Fichter <ianfab@users.noreply.github.com>
Sun, 21 Jun 2020 12:04:28 +0000 (14:04 +0200)
committerFabian Fichter <ianfab@users.noreply.github.com>
Sun, 21 Jun 2020 12:04:28 +0000 (14:04 +0200)
kyotoshogi
LLR: 2.95 (-2.94,2.94) [0.00,10.00]
Total: 776 W: 434 L: 323 D: 19

src/evaluate.cpp

index 78ba6ab..af5b918 100644 (file)
@@ -337,6 +337,9 @@ namespace {
                 score += make_score(PieceValue[MG][pos.promoted_piece_type(Pt)] - PieceValue[MG][Pt],
                                     PieceValue[EG][pos.promoted_piece_type(Pt)] - PieceValue[EG][Pt]) / 10;
         }
+        else if (pos.piece_demotion() && pos.unpromoted_piece_on(s))
+            score -= make_score(PieceValue[MG][Pt] - PieceValue[MG][pos.unpromoted_piece_on(s)],
+                                PieceValue[EG][Pt] - PieceValue[EG][pos.unpromoted_piece_on(s)]) / 4;
         else if (pos.captures_to_hand() && pos.unpromoted_piece_on(s))
             score += make_score(PieceValue[MG][Pt] - PieceValue[MG][pos.unpromoted_piece_on(s)],
                                 PieceValue[EG][Pt] - PieceValue[EG][pos.unpromoted_piece_on(s)]) / 8;