Correct bug in group size impacting DUDD cost

This commit is contained in:
Quentin Rendu
2023-12-19 15:12:32 +01:00
parent e2c007e3b2
commit f854873cc0
2 changed files with 4 additions and 2 deletions

View File

@@ -24,7 +24,7 @@ abstract class BasePairingHelper(
}
// pairables sorted for pairing purposes
protected val pairingSortedPairables by lazy {
pairables.sortedWith(::pairingSort)
pairables.sortedWith(::pairingSort).toMutableList()
}
// pairables sorted for pairing purposes
protected val nameSortedPairables by lazy {

View File

@@ -79,6 +79,8 @@ sealed class BaseSolver(
println("Bye player : " + chosenByePlayer.nameSeed())
byePlayers.add(chosenByePlayer)
nameSortedPairables.remove(chosenByePlayer)
// Keep chosenByePlayer in pairingSortedPairables to be identical to opengotha
pairingSortedPairables.remove(ByePlayer)
}
for (i in nameSortedPairables.indices) {
@@ -326,7 +328,7 @@ sealed class BaseSolver(
}
if(debug){
println("Names "+upperSP.nameSeed()+" "+lowerSP.nameSeed())
println("Names "+upperSP.nameSeed()+" "+upperSP.group+" "+lowerSP.nameSeed()+" "+lowerSP.group)
println("DUDD scenario, GroupDiff = "+scenario.toString()+" "+(upperSP.group-lowerSP.group).toString())
println("DUDD Upper/Lower modes = "+pairing.main.drawUpDownUpperMode.toString()+" "+pairing.main.drawUpDownLowerMode.toString())
println("u/lSPgroupsize = "+uSPgroupSize.toString()+" "+lSPgroupSize.toString())