mirror of
https://github.com/eclipse-sailing-analytics/sailing-analytics.git
synced 2026-10-08 21:30:57 +00:00
fixed comparator which fixed thr first trivial leaderboard scoring test
This commit is contained in:
1 parent
5a2107934c
commit
2b2e2486bf
2 files changed
+4
-3
No files matched your search
-2
@@ -361,8 +361,6 @@ public abstract class AbstractLeaderboardImpl implements Leaderboard {
|
||||
result.add(competitor);
|
||||
}
|
||||
Collections.sort(result, getTotalRankComparator(timePoint));
|
||||
// TODO issues:
|
||||
// - we don't know which competitors compete in those fleets for which we have no tracked race in a column
|
||||
return result;
|
||||
}
|
||||
|
||||
|
||||
+4
-1
@@ -75,7 +75,7 @@ public class LeaderboardTotalRankComparator implements Comparator<Competitor> {
|
||||
o1Scores.add(o1Score);
|
||||
o1ScoreSum += o1Score;
|
||||
}
|
||||
final int o2Score = getLeaderboard().getTotalPoints(o1, raceColumn, timePoint);
|
||||
final int o2Score = getLeaderboard().getTotalPoints(o2, raceColumn, timePoint);
|
||||
if (o2Score != 0) {
|
||||
o2Scores.add(o2Score);
|
||||
o2ScoreSum += o2Score;
|
||||
@@ -86,6 +86,9 @@ public class LeaderboardTotalRankComparator implements Comparator<Competitor> {
|
||||
if (preemptiveColumnResult == 0) {
|
||||
preemptiveColumnResult = compareByFleet(raceColumn, o1, o2);
|
||||
}
|
||||
if (preemptiveColumnResult != 0) {
|
||||
return preemptiveColumnResult;
|
||||
}
|
||||
}
|
||||
// now count the races in which they scored; if they scored in a different number of races, prefer the competitor
|
||||
// who scored more often; otherwise, prefer the competitor who has a better score sum; if score sums are equal, break
|
||||
|
||||
Reference in new issue
Block a user