Remove games against ByePlayer when computing colorBalance

This commit is contained in:
Quentin Rendu
2023-12-28 16:22:42 +01:00
parent e2b64df771
commit 82dfe7d825
10 changed files with 28257 additions and 1315 deletions

View File

@@ -40,6 +40,8 @@ open class HistoryHelper(protected val history: List<List<Game>>, scoresGetter:
private val colorBalance: Map<ID, Int> by lazy {
history.flatten().filter { game ->
game.handicap == 0
}.filter { game ->
game.white != 0
}.flatMap { game ->
listOf(Pair(game.white, +1), Pair(game.black, -1))
}.groupingBy {

View File

@@ -79,9 +79,6 @@ sealed class BaseSolver(
nameSortedPairables.remove(chosenByePlayer)
// Keep chosenByePlayer in pairingSortedPairables to be identical to opengotha
pairingSortedPairables.remove(ByePlayer)
println("a bit of debug")
println(pairingSortedPairables.size)
println(chosenByePlayer.placeInGroup)
}
for (i in nameSortedPairables.indices) {
@@ -125,6 +122,10 @@ sealed class BaseSolver(
//println("DUDD debug")
//println(nameSortedPairables[2].nameSeed() + " " + nameSortedPairables[6].nameSeed())
//pairing.main.applyDUDD(nameSortedPairables[2],nameSortedPairables[6], debug=true)
println("Standings debug: place Name group score ranking rating")
for (p in pairingSortedPairables){
println(p.place.toString() + " " + p.nameSeed() + " " + p.group.toString() + " " + p.main.toString() + " " + p.displayRank() + " " + p.rating)
}
println("Seeding debug")
pairing.main.applySeeding(nameSortedPairables[20],nameSortedPairables[9], debug=true)
pairing.main.applySeeding(nameSortedPairables[9],nameSortedPairables[20], debug=true)
@@ -396,6 +397,7 @@ sealed class BaseSolver(
println("groupsize = "+p1.placeInGroup.second.toString()+" "+p2.placeInGroup.second.toString()+" "+groupSize)
println("place in group p1 = "+cla1.toString()+" p2 = "+cla2.toString())
println("score = " + Math.round(score).toString())
println("detrandom(p1,p2) = " + (maxSeedingWeight-detRandom(seedingWeight*0.2, p1, p2)).toString())
}
}
return Math.round(score).toDouble()