From 12ae4b00836c9827df16b08e43961c4cf9cf5e71 Mon Sep 17 00:00:00 2001 From: Claude Brisson Date: Wed, 4 Sep 2024 20:39:36 +0200 Subject: [PATCH] Fix swiss scores --- .../org/jeudego/pairgoth/pairing/solver/SwissSolver.kt | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/api-webapp/src/main/kotlin/org/jeudego/pairgoth/pairing/solver/SwissSolver.kt b/api-webapp/src/main/kotlin/org/jeudego/pairgoth/pairing/solver/SwissSolver.kt index cf59bab..d5324d4 100644 --- a/api-webapp/src/main/kotlin/org/jeudego/pairgoth/pairing/solver/SwissSolver.kt +++ b/api-webapp/src/main/kotlin/org/jeudego/pairgoth/pairing/solver/SwissSolver.kt @@ -17,8 +17,9 @@ class SwissSolver(round: Int, // In a Swiss tournament the main criterion is the number of wins and already computed override val scores by lazy { - historyHelper.wins.mapValues { - Pair(0.0, it.value) } + pairablesMap.mapValues { + Pair(0.0, historyHelper.wins[it.value.id] ?: 0.0) + } } override val scoresX: Map get() = scores.mapValues { it.value.second }