Symmetric detrandom
This commit is contained in:
@@ -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
|
||||
}
|
||||
|
||||
|
@@ -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
|
||||
|
Reference in New Issue
Block a user