Correct bug on handicap.color

This commit is contained in:
Quentin Rendu
2023-10-24 11:17:39 +02:00
parent cc4790cbf0
commit 72f59a6bde

View File

@@ -94,6 +94,7 @@ sealed class BaseSolver(
File(WEIGHTS_FILE).appendText("secHandiCost="+dec.format(pairing.handicap.handicap(p, q))+"\n") File(WEIGHTS_FILE).appendText("secHandiCost="+dec.format(pairing.handicap.handicap(p, q))+"\n")
File(WEIGHTS_FILE).appendText("secGeoCost="+dec.format(pairing.geo.apply(p, q))+"\n") File(WEIGHTS_FILE).appendText("secGeoCost="+dec.format(pairing.geo.apply(p, q))+"\n")
File(WEIGHTS_FILE).appendText("totalCost="+dec.format(openGothaWeight(p,q))+"\n") File(WEIGHTS_FILE).appendText("totalCost="+dec.format(openGothaWeight(p,q))+"\n")
} }
} }
} }
@@ -109,7 +110,7 @@ sealed class BaseSolver(
if (DEBUG_EXPORT_WEIGHT) { if (DEBUG_EXPORT_WEIGHT) {
for (it in sorted) { for (it in sorted) {
println(it[0].nameSeed() + " " + it[0].place.toString() + " vs " +it[1].nameSeed() + " " +it[1].place.toString()) println(it[0].nameSeed() + " " + it[0].place.toString() + " " + it[0].colorBalance.toString() + " vs " +it[1].nameSeed() + " " +it[1].place.toString() + " " + it[1].colorBalance.toString())
} }
} }
@@ -435,9 +436,9 @@ sealed class BaseSolver(
val hd = pairing.handicap.handicap(p1,p2) val hd = pairing.handicap.handicap(p1,p2)
if(hd==0){ if(hd==0){
if (p1.colorBalance > p2.colorBalance) { if (p1.colorBalance > p2.colorBalance) {
score = 1.0 score = - 1.0
} else if (p1.colorBalance < p2.colorBalance) { } else if (p1.colorBalance < p2.colorBalance) {
score = -1.0 score = 1.0
} else { // choose color from a det random } else { // choose color from a det random
if (detRandom(1.0, p1, p2) === 0.0) { if (detRandom(1.0, p1, p2) === 0.0) {
score = 1.0 score = 1.0