Skip to content

Commit

Permalink
Fix Pass 2 of the ranking algorithm not clamping additionally request…
Browse files Browse the repository at this point in the history
…ed discard multipliers to 0
  • Loading branch information
timoschwarzer committed Jul 7, 2024
1 parent 260e19f commit 3fe58cf
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions src/main/kotlin/wotw/server/database/model/LeagueSeason.kt
Original file line number Diff line number Diff line change
Expand Up @@ -228,13 +228,12 @@ class LeagueSeason(id: EntityID<Long>) : LongEntity(id) {
}

// Pass 2: Find outliers and discard them right away as much as possible
/*
for (submission in submissions) {
if (additionalPartsDiscarded >= availableAdditionalParts) {
break
}

val partRequestedToDiscardAdditionally = inverseLerp(outlierMinPoints, outlierMaxPoints, submission.points.toDouble())
val partRequestedToDiscardAdditionally = max(0.0, inverseLerp(outlierMaxPoints, outlierMinPoints, submission.points.toDouble()))

val partToActuallyDiscardAdditionally = min(
submission.rankingMultiplier.toDouble(),
Expand All @@ -244,7 +243,6 @@ class LeagueSeason(id: EntityID<Long>) : LongEntity(id) {
submission.rankingMultiplier -= partToActuallyDiscardAdditionally.toFloat()
additionalPartsDiscarded += partToActuallyDiscardAdditionally
}
*/

// Pass 3: If we discarded additional parts (outliers), compensate them by boosting games around the average
submissions.minByOrNull { abs(it.points - averagePoints) }?.let { gameNearestToAverage ->
Expand Down

0 comments on commit 3fe58cf

Please sign in to comment.