From 95393e1aa9b8b947981514bc84d3fca02ef03f6f Mon Sep 17 00:00:00 2001 From: Claude Brisson Date: Wed, 4 Sep 2024 21:01:21 +0200 Subject: [PATCH] Fixed all tests --- .../kotlin/org/jeudego/pairgoth/pairing/HistoryHelper.kt | 2 +- .../org/jeudego/pairgoth/pairing/solver/BaseSolver.kt | 6 ++++++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/api-webapp/src/main/kotlin/org/jeudego/pairgoth/pairing/HistoryHelper.kt b/api-webapp/src/main/kotlin/org/jeudego/pairgoth/pairing/HistoryHelper.kt index ad2e538..0255917 100644 --- a/api-webapp/src/main/kotlin/org/jeudego/pairgoth/pairing/HistoryHelper.kt +++ b/api-webapp/src/main/kotlin/org/jeudego/pairgoth/pairing/HistoryHelper.kt @@ -50,7 +50,7 @@ open class HistoryHelper( history.flatten().filter { game -> game.handicap == 0 }.filter { game -> - game.white != ByePlayer.id // Remove games against byePlayer + game.white != ByePlayer.id && game.black != ByePlayer.id // Remove games against byePlayer }.flatMap { game -> listOf(Pair(game.white, +1), Pair(game.black, -1)) }.groupingBy { diff --git a/api-webapp/src/main/kotlin/org/jeudego/pairgoth/pairing/solver/BaseSolver.kt b/api-webapp/src/main/kotlin/org/jeudego/pairgoth/pairing/solver/BaseSolver.kt index d1a1a6f..e1b4b17 100644 --- a/api-webapp/src/main/kotlin/org/jeudego/pairgoth/pairing/solver/BaseSolver.kt +++ b/api-webapp/src/main/kotlin/org/jeudego/pairgoth/pairing/solver/BaseSolver.kt @@ -195,6 +195,12 @@ sealed class BaseSolver( val potentialHd: Int = max(hd1, hd2) val score = if (potentialHd == 0) { + if (round == 4 && ( + p1.fullName() == "Marechal Morgane" && p2.fullName() == "Goloubkov Alexandra" + || p2.fullName() == "Marechal Morgane" && p1.fullName() == "Goloubkov Alexandra" + )) { + println("@@@@ BP color balance") + } val wb1: Int = p1.colorBalance val wb2: Int = p2.colorBalance if (wb1 * wb2 < 0) colorBalanceWeight