BOTTOM/TOP default for DUDD

This commit is contained in:
Theo Barollet
2024-01-22 18:08:48 +01:00
parent 86ec4af88e
commit b4a928b894
4 changed files with 19 additions and 10 deletions

View File

@@ -28,6 +28,10 @@ data class Game(
fun fromSymbol(c: Char) = byChar[c] ?: throw Error("unknown result symbol: $c") fun fromSymbol(c: Char) = byChar[c] ?: throw Error("unknown result symbol: $c")
} }
} }
fun bipPlayed(): Boolean {
return white == ByePlayer.id ||black == ByePlayer.id
}
} }
// serialization // serialization

View File

@@ -40,8 +40,8 @@ data class MainCritParams(
val scoreWeight: Double = MAX_SCORE_WEIGHT, // opengotha minimizeScoreDifference val scoreWeight: Double = MAX_SCORE_WEIGHT, // opengotha minimizeScoreDifference
val drawUpDownWeight: Double = MAX_DRAW_UP_DOWN_WEIGHT, // opengotha DUDDWeight val drawUpDownWeight: Double = MAX_DRAW_UP_DOWN_WEIGHT, // opengotha DUDDWeight
val compensateDrawUpDown: Boolean = true, val compensateDrawUpDown: Boolean = true,
val drawUpDownUpperMode: DrawUpDown = DrawUpDown.MIDDLE, val drawUpDownUpperMode: DrawUpDown = DrawUpDown.BOTTOM,
val drawUpDownLowerMode: DrawUpDown = DrawUpDown.MIDDLE, val drawUpDownLowerMode: DrawUpDown = DrawUpDown.TOP,
val seedingWeight: Double = MAX_SEEDING_WEIGHT, // 5 *10^6, opengotha maximizeSeeding val seedingWeight: Double = MAX_SEEDING_WEIGHT, // 5 *10^6, opengotha maximizeSeeding
val lastRoundForSeedSystem1: Int = 1, val lastRoundForSeedSystem1: Int = 1,
val seedSystem1: SeedMethod = SeedMethod.SPLIT_AND_RANDOM, val seedSystem1: SeedMethod = SeedMethod.SPLIT_AND_RANDOM,

View File

@@ -5,6 +5,11 @@ import org.jeudego.pairgoth.model.Game.Result.*
open class HistoryHelper(protected val history: List<List<Game>>, scoresGetter: HistoryHelper.()-> Map<ID, Double>) { open class HistoryHelper(protected val history: List<List<Game>>, scoresGetter: HistoryHelper.()-> Map<ID, Double>) {
// List of all the pairables ID present in the history
val allPairables = history.flatten()
.map { game -> listOf(game.white, game.black) }
.flatten().distinct()
private val Game.blackScore get() = when (result) { private val Game.blackScore get() = when (result) {
BLACK, BOTHWIN -> 1.0 BLACK, BOTHWIN -> 1.0
else -> 0.0 else -> 0.0

View File

@@ -392,14 +392,14 @@ sealed class BaseSolver(
} }
} }
if(true){ // if(true){
println("Names "+p1.nameSeed()+" "+p1.group+" "+p2.nameSeed()+" "+p2.group) // println("Names "+p1.nameSeed()+" "+p1.group+" "+p2.nameSeed()+" "+p2.group)
println("Seed Sytem = " + currentSeedSystem.toString()) // println("Seed Sytem = " + currentSeedSystem.toString())
println("groupsize = "+p1.placeInGroup.second.toString()+" "+p2.placeInGroup.second.toString()+" "+groupSize) // println("groupsize = "+p1.placeInGroup.second.toString()+" "+p2.placeInGroup.second.toString()+" "+groupSize)
println("place in group p1 = "+cla1.toString()+" p2 = "+cla2.toString()) // println("place in group p1 = "+cla1.toString()+" p2 = "+cla2.toString())
println("score = " + Math.round(score).toString()) // println("score = " + Math.round(score).toString())
println("detrandom(p1,p2) = " + (maxSeedingWeight-detRandom(seedingWeight*0.2, p1, p2)).toString()) // println("detrandom(p1,p2) = " + (maxSeedingWeight-detRandom(seedingWeight*0.2, p1, p2)).toString())
} // }
} }
return Math.round(score).toDouble() return Math.round(score).toDouble()
} }