From dfff64c8b479272df3ed469db9122b384a771fb0 Mon Sep 17 00:00:00 2001 From: Quentin Rendu Date: Tue, 28 May 2024 11:08:04 +0200 Subject: [PATCH] Update secondary criteria to match OpenGotha v3.52 --- .../org/jeudego/pairgoth/pairing/solver/MacMahonSolver.kt | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/api-webapp/src/main/kotlin/org/jeudego/pairgoth/pairing/solver/MacMahonSolver.kt b/api-webapp/src/main/kotlin/org/jeudego/pairgoth/pairing/solver/MacMahonSolver.kt index 1c699b0..a529477 100644 --- a/api-webapp/src/main/kotlin/org/jeudego/pairgoth/pairing/solver/MacMahonSolver.kt +++ b/api-webapp/src/main/kotlin/org/jeudego/pairgoth/pairing/solver/MacMahonSolver.kt @@ -48,11 +48,13 @@ class MacMahonSolver(round: Int, // Test whether each pairable meets one of the criteria // subtract Pairable.MIN_RANK to thresholds to convert ranks to MMS score if (2 * p1.nbW >= nbw2Threshold - || barThresholdActive && (p1.mms >= mmBar - Pairable.MIN_RANK) + // check if STARTING MMS is above MM bar (OpenGotha v3.52 behavior) + || barThresholdActive && ((p1.mms-p1.nbW) >= mmBar - Pairable.MIN_RANK) || p1.mms >= rankSecThreshold - Pairable.MIN_RANK) playersMeetCriteria++ if (2 * p2.nbW >= nbw2Threshold - || barThresholdActive && (p2.mms >= mmBar - Pairable.MIN_RANK) + // check if STARTING MMS is above MM bar (OpenGotha v3.52 behavior) + || barThresholdActive && ((p2.mms-p2.nbW) >= mmBar - Pairable.MIN_RANK) || p2.mms >= rankSecThreshold - Pairable.MIN_RANK) playersMeetCriteria++ return pairing.geo.apply(p1, p2, playersMeetCriteria)