Option to use baseMMS+round/2 for SOS
This commit is contained in:
@@ -38,13 +38,15 @@ fun Tournament<*>.getSortedPairables(round: Int): List<Json.Object> {
|
|||||||
else pairables.mapValues {
|
else pairables.mapValues {
|
||||||
it.value.let { pairable ->
|
it.value.let { pairable ->
|
||||||
val mmBase = pairable.mmBase()
|
val mmBase = pairable.mmBase()
|
||||||
|
val score = roundScore(mmBase +
|
||||||
|
(nbW(pairable) ?: 0.0) + // TODO take tournament parameter into account
|
||||||
|
(1..round).map { round ->
|
||||||
|
if (playersPerRound.getOrNull(round - 1)?.contains(pairable.id) == true) 0 else 1
|
||||||
|
}.sum() * pairing.pairingParams.main.mmsValueAbsent)
|
||||||
Pair(
|
Pair(
|
||||||
mmBase,
|
if (pairing.pairingParams.main.sosValueAbsentUseBase) mmBase
|
||||||
roundScore(mmBase +
|
else roundScore(mmBase + round/2),
|
||||||
(nbW(pairable) ?: 0.0) + // TODO take tournament parameter into account
|
score
|
||||||
(1..round).map { round ->
|
|
||||||
if (playersPerRound.getOrNull(round - 1)?.contains(pairable.id) == true) 0 else 1
|
|
||||||
}.sum() * pairing.pairingParams.main.mmsValueAbsent)
|
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -51,7 +51,8 @@ data class MainCritParams(
|
|||||||
val additionalPlacementCritSystem1: Criterion = Criterion.RATING,
|
val additionalPlacementCritSystem1: Criterion = Criterion.RATING,
|
||||||
val additionalPlacementCritSystem2: Criterion = Criterion.NONE,
|
val additionalPlacementCritSystem2: Criterion = Criterion.NONE,
|
||||||
val mmsValueAbsent: Double = 0.5,
|
val mmsValueAbsent: Double = 0.5,
|
||||||
val roundDownScore: Boolean = true
|
val roundDownScore: Boolean = true,
|
||||||
|
val sosValueAbsentUseBase: Boolean = true
|
||||||
) {
|
) {
|
||||||
enum class DrawUpDown { TOP, MIDDLE, BOTTOM }
|
enum class DrawUpDown { TOP, MIDDLE, BOTTOM }
|
||||||
enum class SeedMethod { SPLIT_AND_FOLD, SPLIT_AND_RANDOM, SPLIT_AND_SLIP }
|
enum class SeedMethod { SPLIT_AND_FOLD, SPLIT_AND_RANDOM, SPLIT_AND_SLIP }
|
||||||
@@ -245,7 +246,8 @@ fun MainCritParams.Companion.fromJson(json: Json.Object, localDefault: MainCritP
|
|||||||
additionalPlacementCritSystem1 = json.getString("firstSeedAddCrit")?.let { Criterion.valueOf(it) } ?: localDefault?.additionalPlacementCritSystem1 ?: default.additionalPlacementCritSystem1,
|
additionalPlacementCritSystem1 = json.getString("firstSeedAddCrit")?.let { Criterion.valueOf(it) } ?: localDefault?.additionalPlacementCritSystem1 ?: default.additionalPlacementCritSystem1,
|
||||||
additionalPlacementCritSystem2 = json.getString("secondSeedAddCrit")?.let { Criterion.valueOf(it) } ?: localDefault?.additionalPlacementCritSystem2 ?: default.additionalPlacementCritSystem2,
|
additionalPlacementCritSystem2 = json.getString("secondSeedAddCrit")?.let { Criterion.valueOf(it) } ?: localDefault?.additionalPlacementCritSystem2 ?: default.additionalPlacementCritSystem2,
|
||||||
mmsValueAbsent = json.getDouble("mmsValueAbsent") ?: localDefault?.mmsValueAbsent ?: default.mmsValueAbsent,
|
mmsValueAbsent = json.getDouble("mmsValueAbsent") ?: localDefault?.mmsValueAbsent ?: default.mmsValueAbsent,
|
||||||
roundDownScore = json.getBoolean("roundDownScore") ?: localDefault?.roundDownScore ?: default.roundDownScore
|
roundDownScore = json.getBoolean("roundDownScore") ?: localDefault?.roundDownScore ?: default.roundDownScore,
|
||||||
|
sosValueAbsentUseBase = json.getBoolean("sosValueAbsentUseBase") ?: localDefault?.sosValueAbsentUseBase ?: default.sosValueAbsentUseBase
|
||||||
)
|
)
|
||||||
|
|
||||||
fun MainCritParams.toJson() = Json.Object(
|
fun MainCritParams.toJson() = Json.Object(
|
||||||
@@ -262,7 +264,8 @@ fun MainCritParams.toJson() = Json.Object(
|
|||||||
"firstSeedAddCrit" to additionalPlacementCritSystem1,
|
"firstSeedAddCrit" to additionalPlacementCritSystem1,
|
||||||
"secondSeedAddCrit" to additionalPlacementCritSystem2,
|
"secondSeedAddCrit" to additionalPlacementCritSystem2,
|
||||||
"mmsValueAbsent" to mmsValueAbsent,
|
"mmsValueAbsent" to mmsValueAbsent,
|
||||||
"roundDownScore" to roundDownScore
|
"roundDownScore" to roundDownScore,
|
||||||
|
"sosValueAbsentUseBase" to sosValueAbsentUseBase
|
||||||
)
|
)
|
||||||
|
|
||||||
fun SecondaryCritParams.Companion.fromJson(json: Json.Object, localDefault: SecondaryCritParams? = null) = SecondaryCritParams(
|
fun SecondaryCritParams.Companion.fromJson(json: Json.Object, localDefault: SecondaryCritParams? = null) = SecondaryCritParams(
|
||||||
|
@@ -20,11 +20,14 @@ class MacMahonSolver(round: Int,
|
|||||||
val pairing = pairables.map { it.id }.toSet()
|
val pairing = pairables.map { it.id }.toSet()
|
||||||
pairablesMap.mapValues {
|
pairablesMap.mapValues {
|
||||||
it.value.let { pairable ->
|
it.value.let { pairable ->
|
||||||
Pair(
|
val score = roundScore(pairable.mmBase +
|
||||||
pairable.mmBase,
|
|
||||||
roundScore(pairable.mmBase +
|
|
||||||
pairable.nbW + // TODO take tournament parameter into account
|
pairable.nbW + // TODO take tournament parameter into account
|
||||||
pairable.missedRounds(round, pairing) * pairingParams.main.mmsValueAbsent))
|
pairable.missedRounds(round, pairing) * pairingParams.main.mmsValueAbsent)
|
||||||
|
Pair(
|
||||||
|
if (pairingParams.main.sosValueAbsentUseBase) pairable.mmBase
|
||||||
|
else roundScore(pairable.mmBase + round/2),
|
||||||
|
score
|
||||||
|
)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -216,6 +216,7 @@ onLoad(() => {
|
|||||||
main: {
|
main: {
|
||||||
mmsValueAbsent: form.val('mmsValueAbsent'),
|
mmsValueAbsent: form.val('mmsValueAbsent'),
|
||||||
roundDownScore: form.val('roundDownScore'),
|
roundDownScore: form.val('roundDownScore'),
|
||||||
|
sosValueAbsentUseBase: form.val('sosValueAbsentUseBase'),
|
||||||
firstSeedLastRound: form.val('firstSeedLastRound'),
|
firstSeedLastRound: form.val('firstSeedLastRound'),
|
||||||
firstSeedAddCrit: form.val('firstSeedAddRating') ? 'RATING' : 'NONE', // TODO use client side boolean
|
firstSeedAddCrit: form.val('firstSeedAddRating') ? 'RATING' : 'NONE', // TODO use client side boolean
|
||||||
firstSeed: form.val('firstSeed'),
|
firstSeed: form.val('firstSeed'),
|
||||||
|
@@ -36,6 +36,18 @@
|
|||||||
</label>
|
</label>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
<div class="inline fields">
|
||||||
|
<div class="field">
|
||||||
|
<label>
|
||||||
|
For SOS/SOSOS calculations, use
|
||||||
|
<select name="sosValueAbsentUseBase">
|
||||||
|
<option value="true" #if($tour.pairing.main.sosValueAbsentUseBase) selected #end>base MMS</option>
|
||||||
|
<option value="false" #if(!$tour.pairing.main.sosValueAbsentUseBase) selected #end>base MMS + rounds/2</option>
|
||||||
|
</select>
|
||||||
|
of self player when absent from rounds
|
||||||
|
</label>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
#end
|
#end
|
||||||
<div class="ui fluid styled accordion">
|
<div class="ui fluid styled accordion">
|
||||||
<div class="title"><i class="dropdown icon"></i>Seeding methods inside groups of same score</div>
|
<div class="title"><i class="dropdown icon"></i>Seeding methods inside groups of same score</div>
|
||||||
|
Reference in New Issue
Block a user