diff --git a/api-webapp/src/main/kotlin/org/jeudego/pairgoth/model/Game.kt b/api-webapp/src/main/kotlin/org/jeudego/pairgoth/model/Game.kt index 8bae5b3..252f7cb 100644 --- a/api-webapp/src/main/kotlin/org/jeudego/pairgoth/model/Game.kt +++ b/api-webapp/src/main/kotlin/org/jeudego/pairgoth/model/Game.kt @@ -28,6 +28,10 @@ data class Game( fun fromSymbol(c: Char) = byChar[c] ?: throw Error("unknown result symbol: $c") } } + + fun bipPlayed(): Boolean { + return white == ByePlayer.id ||black == ByePlayer.id + } } // serialization diff --git a/api-webapp/src/main/kotlin/org/jeudego/pairgoth/model/Pairing.kt b/api-webapp/src/main/kotlin/org/jeudego/pairgoth/model/Pairing.kt index 9f52d14..f287b27 100644 --- a/api-webapp/src/main/kotlin/org/jeudego/pairgoth/model/Pairing.kt +++ b/api-webapp/src/main/kotlin/org/jeudego/pairgoth/model/Pairing.kt @@ -40,8 +40,8 @@ data class MainCritParams( val scoreWeight: Double = MAX_SCORE_WEIGHT, // opengotha minimizeScoreDifference val drawUpDownWeight: Double = MAX_DRAW_UP_DOWN_WEIGHT, // opengotha DUDDWeight val compensateDrawUpDown: Boolean = true, - val drawUpDownUpperMode: DrawUpDown = DrawUpDown.MIDDLE, - val drawUpDownLowerMode: DrawUpDown = DrawUpDown.MIDDLE, + val drawUpDownUpperMode: DrawUpDown = DrawUpDown.BOTTOM, + val drawUpDownLowerMode: DrawUpDown = DrawUpDown.TOP, val seedingWeight: Double = MAX_SEEDING_WEIGHT, // 5 *10^6, opengotha maximizeSeeding val lastRoundForSeedSystem1: Int = 1, val seedSystem1: SeedMethod = SeedMethod.SPLIT_AND_RANDOM, diff --git a/api-webapp/src/main/kotlin/org/jeudego/pairgoth/pairing/HistoryHelper.kt b/api-webapp/src/main/kotlin/org/jeudego/pairgoth/pairing/HistoryHelper.kt index 2fd5127..04e5608 100644 --- a/api-webapp/src/main/kotlin/org/jeudego/pairgoth/pairing/HistoryHelper.kt +++ b/api-webapp/src/main/kotlin/org/jeudego/pairgoth/pairing/HistoryHelper.kt @@ -5,6 +5,11 @@ import org.jeudego.pairgoth.model.Game.Result.* open class HistoryHelper(protected val history: List>, scoresGetter: HistoryHelper.()-> Map) { + // 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) { BLACK, BOTHWIN -> 1.0 else -> 0.0 diff --git a/api-webapp/src/main/kotlin/org/jeudego/pairgoth/pairing/solver/BaseSolver.kt b/api-webapp/src/main/kotlin/org/jeudego/pairgoth/pairing/solver/BaseSolver.kt index 6a0603a..1589b68 100644 --- a/api-webapp/src/main/kotlin/org/jeudego/pairgoth/pairing/solver/BaseSolver.kt +++ b/api-webapp/src/main/kotlin/org/jeudego/pairgoth/pairing/solver/BaseSolver.kt @@ -392,14 +392,14 @@ sealed class BaseSolver( } } - if(true){ - println("Names "+p1.nameSeed()+" "+p1.group+" "+p2.nameSeed()+" "+p2.group) - println("Seed Sytem = " + currentSeedSystem.toString()) - 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()) - } +// if(true){ +// println("Names "+p1.nameSeed()+" "+p1.group+" "+p2.nameSeed()+" "+p2.group) +// println("Seed Sytem = " + currentSeedSystem.toString()) +// 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() }