Fix bug in missed rounds computation

This commit is contained in:
Claude Brisson
2024-01-30 16:31:07 +01:00
parent 727b341521
commit 9e3547fbd9
3 changed files with 3 additions and 3 deletions

View File

@@ -92,7 +92,7 @@ abstract class BasePairingHelper(
val Pairable.sodos: Double get() = historyHelper.sodos[id] ?: 0.0
val Pairable.cums: Double get() = historyHelper.cumScore[id] ?: 0.0
fun Pairable.missedRounds(upToRound: Int, pairing: Set<ID>): Int = (1..upToRound).map { round ->
if (historyHelper.playersPerRound.getOrNull(round - 1)?.contains(id) == true || pairing.contains(id)) 0 else 1
if (historyHelper.playersPerRound.getOrNull(round - 1)?.contains(id) == true || round == upToRound && pairing.contains(id)) 0 else 1
}.sum()
fun Pairable.eval(criterion: Criterion) = evalCriterion(this, criterion)
open fun evalCriterion(pairable: Pairable, criterion: Criterion) = when (criterion) {

View File

@@ -19,6 +19,8 @@ object EGFRatingsHandler: RatingsHandler(RatingsManager.Ratings.EGF) {
}.toTypedArray()
Json.MutableObject(*pairs).also {
it["origin"] = "EGF"
// override rank with rating equivalent
val rating = it["rating"]?.toString()?.toIntOrNull()
}
}
}

View File

@@ -10,8 +10,6 @@
</div>
<div class="tournaments section">
#set($files = $api.get('tour'))
$log.info("@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@")
$log.info($files)
#if($files.containsKey('error'))
#set($error = $files.error)
#elseif($files.containsKey('message'))