Fix sos & co display

This commit is contained in:
Claude Brisson
2024-09-29 19:59:42 +02:00
parent 3b4bd61eb2
commit 0f7c6dfadf

View File

@@ -39,8 +39,13 @@ fun Tournament<*>.getSortedPairables(round: Int, includePreliminary: Boolean = f
// CB TODO - factorize history helper creation between here and solver classes
val historyHelper = HistoryHelper(historyBefore(round + 1)) {
if (pairing.type == PairingType.SWISS) wins.mapValues { Pair(0.0, it.value) }
else pairables.mapValues {
if (pairing.type == PairingType.SWISS) {
pairables.mapValues {
Pair(0.0, wins[it.key] ?: 0.0)
}
}
else {
pairables.mapValues {
it.value.let { pairable ->
val mmBase = pairable.mmBase()
val score = roundScore(mmBase +
@@ -56,6 +61,7 @@ fun Tournament<*>.getSortedPairables(round: Int, includePreliminary: Boolean = f
}
}
}
}
val neededCriteria = ArrayList(pairing.placementParams.criteria)
if (!neededCriteria.contains(Criterion.NBW)) neededCriteria.add(Criterion.NBW)
if (!neededCriteria.contains(Criterion.RATING)) neededCriteria.add(Criterion.RATING)