diff --git a/api-webapp/src/main/kotlin/org/jeudego/pairgoth/pairing/Random.kt b/api-webapp/src/main/kotlin/org/jeudego/pairgoth/pairing/Random.kt index 8cb7910..7f4925e 100644 --- a/api-webapp/src/main/kotlin/org/jeudego/pairgoth/pairing/Random.kt +++ b/api-webapp/src/main/kotlin/org/jeudego/pairgoth/pairing/Random.kt @@ -13,7 +13,8 @@ fun detRandom(max: Double, p1: Pairable, p2: Pairable): Double { var nR = "$name1$name2".mapIndexed { i, c -> c.code.toDouble() * (i + 1) }.sum() * 1234567 % (max + 1) - if (inverse) nR = max - nR + // we want the symmetry + // if (inverse) nR = max - nR return nR } 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 694972f..7ad769c 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 @@ -367,9 +367,7 @@ sealed class BaseSolver( SPLIT_AND_RANDOM -> { if ((2 * cla1 < groupSize && 2 * cla2 >= groupSize) || (2 * cla1 >= groupSize && 2 * cla2 < groupSize)) { val randRange = maxSeedingWeight * 0.2 - val rand: Double - if (p1.fullName() > p2.fullName()) {rand = detRandom(randRange, p2, p1)} - else {rand = detRandom(randRange, p1, p2)} + val rand = detRandom(randRange, p2, p1) maxSeedingWeight - rand } else { 0.0