> getRankedCompetitorsFromBestToWorstAfterEachRaceColumn(TimePoint timePoint) throws NoWindException;
/**
- * Computes the competitor's total points sum as they were or would have been after each race column (from left to right)
+ * Computes the competitor's net points sum as they were or would have been after each race column (from left to right)
* was completed.
*
* A leaderboard fills up over time, usually "from left to right" with one race after another finishing.
@@ -173,14 +173,14 @@ public interface Leaderboard extends LeaderboardBase, HasRaceColumns {
* exactly n races. Still, this method pretends such a time point would have existed, actually ignoring
* the times at which a race took place but only looking at the resulting scores and discards.
*
- * When computing the total points sum after all columns up to and including the race column that is the key of the resulting
+ * When computing the net points sum after all columns up to and including the race column that is the key of the resulting
* map, the method applies the discarding and tie breaking rules as they would have had to be applied had the races
* in the respective column just completed.
*
* @return The resulting map is guaranteed to have the same iteration order regarding the race columns
* as {@link #getRaceColumns()}.
*/
- Map> getTotalPointsSumAfterRaceColumn(TimePoint timePoint) throws NoWindException;
+ Map> getNetPointsSumAfterRaceColumn(TimePoint timePoint) throws NoWindException;
/**
* Tells the number of points carried over from previous races not tracked by this leaderboard for
@@ -225,7 +225,7 @@ public interface Leaderboard extends LeaderboardBase, HasRaceColumns {
* @return null if the competitor didn't participate in the race or the race hasn't started yet at
* timePoint
*/
- Double getNetPoints(Competitor competitor, RaceColumn raceColumn, TimePoint timePoint);
+ Double getTotalPoints(Competitor competitor, RaceColumn raceColumn, TimePoint timePoint);
/**
* Tells if and why a competitor received "penalty" points for a race (however the scoring rules define the
@@ -235,7 +235,7 @@ public interface Leaderboard extends LeaderboardBase, HasRaceColumns {
/**
* A possibly corrected number of points for the race specified. Defaults to the result of calling
- * {@link #getNetPoints(Competitor, TrackedRace, TimePoint)} but may be corrected by the regatta rules for
+ * {@link #getTotalPoints(Competitor, TrackedRace, TimePoint)} but may be corrected by the regatta rules for
* discarding results. If {@link #isDiscarded(Competitor, RaceColumn, TimePoint) discarded}, the points returned
* will be 0.
*
@@ -249,7 +249,7 @@ public interface Leaderboard extends LeaderboardBase, HasRaceColumns {
* competitor doesn't appear in any of the race column's attached tracked races. A 0.0 score is returned
* if the competitor's result for race is discarded.
*/
- Double getTotalPoints(Competitor competitor, RaceColumn race, TimePoint timePoint) throws NoWindException;
+ Double getNetPoints(Competitor competitor, RaceColumn race, TimePoint timePoint) throws NoWindException;
/**
* Tells whether the contribution of raceColumn is discarded in the current leaderboard's standings for
@@ -260,17 +260,17 @@ public interface Leaderboard extends LeaderboardBase, HasRaceColumns {
boolean isDiscarded(Competitor competitor, RaceColumn raceColumn, TimePoint timePoint);
/**
- * Sums up the {@link #getTotalPoints(Competitor, TrackedRace, TimePoint) total points} of competitor
+ * Sums up the {@link #getNetPoints(Competitor, TrackedRace, TimePoint) net points} of competitor
* across all races tracked by this leaderboard, respecting the {@link RaceColumn#isStartsWithZeroScore()} property.
*/
- Double getTotalPoints(Competitor competitor, TimePoint timePoint);
+ Double getNetPoints(Competitor competitor, TimePoint timePoint);
/**
- * Sums up the {@link #getTotalPoints(Competitor, RaceColumn, TimePoint) total points} of competitor
+ * Sums up the {@link #getNetPoints(Competitor, RaceColumn, TimePoint) net points} of competitor
* across all race columns listed in raceColumnsToconsider, respecting the
* {@link RaceColumn#isStartsWithZeroScore()} property.
*/
- Double getTotalPoints(Competitor competitor, Iterable raceColumnsToConsider, TimePoint timePoint)
+ Double getNetPoints(Competitor competitor, Iterable raceColumnsToConsider, TimePoint timePoint)
throws NoWindException;
/**
@@ -283,8 +283,8 @@ public interface Leaderboard extends LeaderboardBase, HasRaceColumns {
* {@link Fleet#compareTo(Fleet) ordered fleets} and {@link RaceColumn#isMedalRace() medal races}. The ordering
* does not consider result discarding because when sorting for a race column it is of interest how the competitor
* performed in that race and not how the score affected the overall regatta score. Therefore, it is based on
- * {@link #getNetPoints(Competitor, RaceColumn, TimePoint)} and not on
- * {@link #getTotalPoints(Competitor, RaceColumn, TimePoint)}.
+ * {@link #getTotalPoints(Competitor, RaceColumn, TimePoint)} and not on
+ * {@link #getNetPoints(Competitor, RaceColumn, TimePoint)}.
*/
List getCompetitorsFromBestToWorst(RaceColumn raceColumn, TimePoint timePoint) throws NoWindException;
@@ -306,7 +306,7 @@ public interface Leaderboard extends LeaderboardBase, HasRaceColumns {
* computational effort compared to fetching all entries separately, particularly because all
* {@link #isDiscarded(Competitor, RaceColumn, TimePoint) discarded races} of a competitor are computed in one
* sweep using {@link ResultDiscardingRule#getDiscardedRaceColumns(Competitor, Leaderboard, Iterable, TimePoint)} only once.
- * Note that in order to get the {@link #getTotalPoints(Competitor, TimePoint) total points} for a competitor
+ * Note that in order to get the {@link #getNetPoints(Competitor, TimePoint) total points} for a competitor
* for the entire leaderboard, the {@link #getCarriedPoints(Competitor) carried-over points} need to be added.
*/
Map, Entry> getContent(TimePoint timePoint) throws NoWindException;
@@ -326,7 +326,7 @@ public interface Leaderboard extends LeaderboardBase, HasRaceColumns {
/**
* A leaderboard can carry over points from races that are not tracked by this leaderboard in detail,
* so for which no {@link RaceColumn} column is present in this leaderboard. These scores are
- * simply added to the scores tracked by this leaderboard in the {@link #getTotalPoints(Competitor, TimePoint)}
+ * simply added to the scores tracked by this leaderboard in the {@link #getNetPoints(Competitor, TimePoint)}
* method.
*/
void setCarriedPoints(Competitor competitor, double carriedPoints);
@@ -370,7 +370,7 @@ public interface Leaderboard extends LeaderboardBase, HasRaceColumns {
* that column shall be considered for discarding and counts for determining the number of races so far. Also, if a
* tracked race is connected to the column and has started already, the column is to be considered for discarding
* unless the column has several unordered fleets and not all fleets have started their race yet (see
- * {@link ScoringScheme#isValidInTotalScore(Leaderboard, RaceColumn, Competitor, TimePoint)}).
+ * {@link ScoringScheme#isValidInNetScore(Leaderboard, RaceColumn, Competitor, TimePoint)}).
*/
boolean countRaceForComparisonWithDiscardingThresholds(Competitor competitor, RaceColumn raceColumn, TimePoint timePoint);
@@ -458,14 +458,14 @@ public interface Leaderboard extends LeaderboardBase, HasRaceColumns {
Distance getTotalDistanceTraveled(Competitor competitor, TimePoint timePoint);
/**
- * Same as {@link #getTotalPoints(Competitor, RaceColumn, TimePoint)}, only that for determining the discarded
+ * Same as {@link #getNetPoints(Competitor, RaceColumn, TimePoint)}, only that for determining the discarded
* results only raceColumnsToConsider are considered.
*/
- Double getTotalPoints(Competitor competitor, RaceColumn raceColumn, Iterable raceColumnsToConsider,
+ Double getNetPoints(Competitor competitor, RaceColumn raceColumn, Iterable raceColumnsToConsider,
TimePoint timePoint) throws NoWindException;
/**
- * Same as {@link #getTotalPoints(Competitor, RaceColumn, Iterable, TimePoint)}, only that the set of discarded race columns can
+ * Same as {@link #getNetPoints(Competitor, RaceColumn, Iterable, TimePoint)}, only that the set of discarded race columns can
* be specified which is useful when total points are to be computed for more than one column for the same
* competitor because then the calculation of discards (which requires looking at all columns) only needs to be done
* once and not again for each column (which would lead to quadratic effort).
@@ -475,7 +475,7 @@ public interface Leaderboard extends LeaderboardBase, HasRaceColumns {
* {@link ResultDiscardingRule#getDiscardedRaceColumns(Competitor, Leaderboard, Iterable, TimePoint)
* getDiscardedRaceColumns(competitor, this, raceColumnsToConsider, timePoint)}.
*/
- Double getTotalPoints(Competitor competitor, RaceColumn raceColumn, TimePoint timePoint,
+ Double getNetPoints(Competitor competitor, RaceColumn raceColumn, TimePoint timePoint,
Set discardedRaceColumns);
TimePoint getNowMinusDelay();
@@ -522,7 +522,7 @@ public interface Leaderboard extends LeaderboardBase, HasRaceColumns {
*/
LeaderboardDTO getLeaderboardDTO(TimePoint timePoint,
Collection namesOfRaceColumnsForWhichToLoadLegDetails,
- boolean addOverallDetails, TrackedRegattaRegistry trackedRegattaRegistry, DomainFactory baseDomainFactory, boolean fillNetPointsUncorrected) throws NoWindException,
+ boolean addOverallDetails, TrackedRegattaRegistry trackedRegattaRegistry, DomainFactory baseDomainFactory, boolean fillTotalPointsUncorrected) throws NoWindException,
InterruptedException, ExecutionException;
NumberOfCompetitorsInLeaderboardFetcher getNumberOfCompetitorsInLeaderboardFetcher();
diff --git a/java/com.sap.sailing.domain/src/com/sap/sailing/domain/leaderboard/ScoringScheme.java b/java/com.sap.sailing.domain/src/com/sap/sailing/domain/leaderboard/ScoringScheme.java
index a24a15b96db..1ed0b8a0c4c 100755
--- a/java/com.sap.sailing.domain/src/com/sap/sailing/domain/leaderboard/ScoringScheme.java
+++ b/java/com.sap.sailing.domain/src/com/sap/sailing/domain/leaderboard/ScoringScheme.java
@@ -96,13 +96,13 @@ public interface ScoringScheme extends Serializable {
/**
* Under certain circumstances, a scoring scheme may decide that the scores of a column are not (yet) to be used
- * for the leaderboard's total scores. This may, e.g., be the case if a column is split into more than one fleet and
+ * for the leaderboard's net scores. This may, e.g., be the case if a column is split into more than one fleet and
* those fleets are unordered. In that case, scores need to be available for all fleets before the column counts
- * for the total scores. Another example is a scoring scheme that defines elimination rounds and awards no points
+ * for the net scores. Another example is a scoring scheme that defines elimination rounds and awards no points
* to a competitor in a round from which the competitor got promoted to the next round. Such promotion columns
* then have no scores and don't count in the number of races starting from where discards are applied.
*/
- boolean isValidInTotalScore(Leaderboard leaderboard, RaceColumn raceColumn, Competitor competitor, TimePoint at);
+ boolean isValidInNetScore(Leaderboard leaderboard, RaceColumn raceColumn, Competitor competitor, TimePoint at);
/**
* Some scoring schemes are applied to {@link LeaderboardGroupMetaLeaderboard} instances. These instances of a
diff --git a/java/com.sap.sailing.domain/src/com/sap/sailing/domain/leaderboard/caching/LeaderboardDTOCache.java b/java/com.sap.sailing.domain/src/com/sap/sailing/domain/leaderboard/caching/LeaderboardDTOCache.java
index b1ba96700a0..a2dbb03795c 100755
--- a/java/com.sap.sailing.domain/src/com/sap/sailing/domain/leaderboard/caching/LeaderboardDTOCache.java
+++ b/java/com.sap.sailing.domain/src/com/sap/sailing/domain/leaderboard/caching/LeaderboardDTOCache.java
@@ -166,7 +166,7 @@ public class LeaderboardDTOCache implements LeaderboardCache {
try {
LeaderboardDTO result = leaderboard.computeDTO(adjustedTimePoint,
namesOfRaceColumnsForWhichToLoadLegDetails, addOverallDetails,
- waitForLatestAnalyses, trackedRegattaRegistry, baseDomainFactory, /* fillNetPointsUncorrected */ false);
+ waitForLatestAnalyses, trackedRegattaRegistry, baseDomainFactory, /* fillTotalPointsUncorrected */ false);
return result;
} finally {
LockUtil.unpropagateLockSetFrom(callerThread);
diff --git a/java/com.sap.sailing.domain/src/com/sap/sailing/domain/leaderboard/caching/LiveLeaderboardUpdater.java b/java/com.sap.sailing.domain/src/com/sap/sailing/domain/leaderboard/caching/LiveLeaderboardUpdater.java
index fca7707a2f4..c1b211c7d3b 100755
--- a/java/com.sap.sailing.domain/src/com/sap/sailing/domain/leaderboard/caching/LiveLeaderboardUpdater.java
+++ b/java/com.sap.sailing.domain/src/com/sap/sailing/domain/leaderboard/caching/LiveLeaderboardUpdater.java
@@ -297,7 +297,7 @@ public class LiveLeaderboardUpdater implements Runnable {
final boolean addOverallDetails = getOverallDetails(timePoint);
LeaderboardDTO newCacheValue = leaderboard.computeDTO(timePoint,
namesOfRaceColumnsForWhichToLoadLegDetails, addOverallDetails,
- /* waitForLatestAnalyses */false, trackedRegattaRegistry, baseDomainFactory, /* fillNetPointsUncorrected */ false);
+ /* waitForLatestAnalyses */false, trackedRegattaRegistry, baseDomainFactory, /* fillTotalPointsUncorrected */ false);
updateCacheContents(namesOfRaceColumnsForWhichToLoadLegDetails, addOverallDetails, newCacheValue);
} catch (NoWindException e) {
logger.log(Level.SEVERE, "Exception during re-calculating the live leaderboard "+leaderboard.getName(), e);
diff --git a/java/com.sap.sailing.domain/src/com/sap/sailing/domain/leaderboard/impl/AbstractHighPointExtremeSailingSeriesOverall.java b/java/com.sap.sailing.domain/src/com/sap/sailing/domain/leaderboard/impl/AbstractHighPointExtremeSailingSeriesOverall.java
index 7505bb92988..98e4dcb9c60 100644
--- a/java/com.sap.sailing.domain/src/com/sap/sailing/domain/leaderboard/impl/AbstractHighPointExtremeSailingSeriesOverall.java
+++ b/java/com.sap.sailing.domain/src/com/sap/sailing/domain/leaderboard/impl/AbstractHighPointExtremeSailingSeriesOverall.java
@@ -122,15 +122,15 @@ public abstract class AbstractHighPointExtremeSailingSeriesOverall extends HighP
List randomAccessLeaderboardList = new ArrayList(Util.size(overallLeaderboard.getLeaderboards()));
Util.addAll(overallLeaderboard.getLeaderboards(), randomAccessLeaderboardList);
for (Leaderboard leaderboardInOverall : overallLeaderboard.getLeaderboards()) {
- o1PointsInLeaderboardsOfTheGroup.add(leaderboardInOverall.getTotalPoints(o1, timePoint));
- o2PointsInLeaderboardsOfTheGroup.add(leaderboardInOverall.getTotalPoints(o2, timePoint));
+ o1PointsInLeaderboardsOfTheGroup.add(leaderboardInOverall.getNetPoints(o1, timePoint));
+ o2PointsInLeaderboardsOfTheGroup.add(leaderboardInOverall.getNetPoints(o2, timePoint));
}
int localResult = 0;
for (ListIterator reverseLeaderbaordIterator=randomAccessLeaderboardList.listIterator(randomAccessLeaderboardList.size());
reverseLeaderbaordIterator.hasPrevious(); ) {
Leaderboard leaderboardInOverall = reverseLeaderbaordIterator.previous();
- final Double o1PointsForLeaderboard = leaderboardInOverall.getTotalPoints(o1, timePoint);
- final Double o2PointsForLeaderboard = leaderboardInOverall.getTotalPoints(o2, timePoint);
+ final Double o1PointsForLeaderboard = leaderboardInOverall.getNetPoints(o1, timePoint);
+ final Double o2PointsForLeaderboard = leaderboardInOverall.getNetPoints(o2, timePoint);
if (o1PointsForLeaderboard != null && o2PointsForLeaderboard != null) {
// we're in a scheme where points never get 0 so we can safely assume
// that the last total points that are no 0 are the ones that we want to
diff --git a/java/com.sap.sailing.domain/src/com/sap/sailing/domain/leaderboard/impl/AbstractScoringSchemeImpl.java b/java/com.sap.sailing.domain/src/com/sap/sailing/domain/leaderboard/impl/AbstractScoringSchemeImpl.java
index 793934f0919..65fe5bcaad6 100755
--- a/java/com.sap.sailing.domain/src/com/sap/sailing/domain/leaderboard/impl/AbstractScoringSchemeImpl.java
+++ b/java/com.sap.sailing.domain/src/com/sap/sailing/domain/leaderboard/impl/AbstractScoringSchemeImpl.java
@@ -78,7 +78,7 @@ public abstract class AbstractScoringSchemeImpl implements ScoringScheme {
* more races.
*/
@Override
- public boolean isValidInTotalScore(Leaderboard leaderboard, RaceColumn raceColumn, Competitor competitor, TimePoint at) {
+ public boolean isValidInNetScore(Leaderboard leaderboard, RaceColumn raceColumn, Competitor competitor, TimePoint at) {
boolean result;
Iterable extends Fleet> fleets = raceColumn.getFleets();
if (Util.size(fleets) <= 1 || allFleetsOrdered(fleets)) {
@@ -101,7 +101,7 @@ public abstract class AbstractScoringSchemeImpl implements ScoringScheme {
for (Competitor competitor : leaderboard.getCompetitors()) {
Fleet fleet = raceColumn.getFleetOfCompetitor(competitor);
if (fleetsForWhichNoScoreWasFound.contains(fleet)) {
- if (leaderboard.getNetPoints(competitor, raceColumn, at) != null) {
+ if (leaderboard.getTotalPoints(competitor, raceColumn, at) != null) {
fleetsForWhichNoScoreWasFound.remove(fleet);
}
}
diff --git a/java/com.sap.sailing.domain/src/com/sap/sailing/domain/leaderboard/impl/AbstractSimpleLeaderboardImpl.java b/java/com.sap.sailing.domain/src/com/sap/sailing/domain/leaderboard/impl/AbstractSimpleLeaderboardImpl.java
index 8c9e08365df..336895a9a6f 100755
--- a/java/com.sap.sailing.domain/src/com/sap/sailing/domain/leaderboard/impl/AbstractSimpleLeaderboardImpl.java
+++ b/java/com.sap.sailing.domain/src/com/sap/sailing/domain/leaderboard/impl/AbstractSimpleLeaderboardImpl.java
@@ -130,7 +130,7 @@ public abstract class AbstractSimpleLeaderboardImpl implements Leaderboard, Race
/**
* Backs the {@link #getCarriedPoints(Competitor)} API with data. Can be used to prime this leaderboard
* with aggregated results of races not tracked / displayed by this leaderboard in detail. The points
- * provided by this map are considered by {@link #getTotalPoints(Competitor, TimePoint)}.
+ * provided by this map are considered by {@link #getNetPoints(Competitor, TimePoint)}.
*/
private final Map carriedPoints;
@@ -172,23 +172,23 @@ public abstract class AbstractSimpleLeaderboardImpl implements Leaderboard, Race
*/
class EntryImpl implements Entry {
private final Callable trackedRankProvider;
+ private final Double totalPoints;
+ private final Callable totalPointsUncorrectedProvider;
+ private final boolean isTotalPointsCorrected;
private final Double netPoints;
- private final Callable netPointsUncorrectedProvider;
- private final boolean isNetPointsCorrected;
- private final Double totalPoints;
private final MaxPointsReason maxPointsReason;
private final boolean discarded;
private final Fleet fleet;
- private EntryImpl(Callable trackedRankProvider, Double netPoints,
- Callable netPointsUncorrectedProvider, boolean isNetPointsCorrected,
- Double totalPoints, MaxPointsReason maxPointsReason, boolean discarded, Fleet fleet) {
+ private EntryImpl(Callable trackedRankProvider, Double totalPoints,
+ Callable totalPointsUncorrectedProvider, boolean isTotalPointsCorrected,
+ Double netPoints, MaxPointsReason maxPointsReason, boolean discarded, Fleet fleet) {
super();
this.trackedRankProvider = trackedRankProvider;
+ this.totalPoints = totalPoints;
+ this.totalPointsUncorrectedProvider = totalPointsUncorrectedProvider;
+ this.isTotalPointsCorrected = isTotalPointsCorrected;
this.netPoints = netPoints;
- this.netPointsUncorrectedProvider = netPointsUncorrectedProvider;
- this.isNetPointsCorrected = isNetPointsCorrected;
- this.totalPoints = totalPoints;
this.maxPointsReason = maxPointsReason;
this.discarded = discarded;
this.fleet = fleet;
@@ -202,16 +202,16 @@ public abstract class AbstractSimpleLeaderboardImpl implements Leaderboard, Race
}
}
@Override
- public Double getNetPoints() {
- return netPoints;
+ public Double getTotalPoints() {
+ return totalPoints;
}
@Override
- public boolean isNetPointsCorrected() {
- return isNetPointsCorrected;
+ public boolean isTotalPointsCorrected() {
+ return isTotalPointsCorrected;
}
@Override
- public Double getTotalPoints() {
- return totalPoints;
+ public Double getNetPoints() {
+ return netPoints;
}
@Override
public MaxPointsReason getMaxPointsReason() {
@@ -226,9 +226,9 @@ public abstract class AbstractSimpleLeaderboardImpl implements Leaderboard, Race
return fleet;
}
@Override
- public Double getNetPointsUncorrected() {
+ public Double getTotalPointsUncorrected() {
try {
- return netPointsUncorrectedProvider.call();
+ return totalPointsUncorrectedProvider.call();
} catch (Exception e) {
throw new RuntimeException(e);
}
@@ -437,7 +437,7 @@ public abstract class AbstractSimpleLeaderboardImpl implements Leaderboard, Race
}
@Override
- public Double getNetPoints(final Competitor competitor, final RaceColumn raceColumn, final TimePoint timePoint) {
+ public Double getTotalPoints(final Competitor competitor, final RaceColumn raceColumn, final TimePoint timePoint) {
return getScoreCorrection().getCorrectedScore(
()->getTrackedRank(competitor, raceColumn, timePoint), competitor,
raceColumn, timePoint, new NumberOfCompetitorsFetcherImpl(), getScoringScheme()).getCorrectedScore();
@@ -462,7 +462,7 @@ public abstract class AbstractSimpleLeaderboardImpl implements Leaderboard, Race
/**
* Same as {@link #isDiscarded(Competitor, RaceColumn, TimePoint)}, only that the set of discarded race columns can
- * be specified which is useful when total points are to be computed for more than one column for the same
+ * be specified which is useful when net points are to be computed for more than one column for the same
* competitor because then the calculation of discards (which requires looking at all columns) only needs to be done
* once and not again for each column (which would lead to quadratic effort).
*
@@ -479,21 +479,21 @@ public abstract class AbstractSimpleLeaderboardImpl implements Leaderboard, Race
}
@Override
- public Double getTotalPoints(Competitor competitor, RaceColumn raceColumn, TimePoint timePoint) throws NoWindException {
- return getTotalPoints(competitor, raceColumn, getRaceColumns(), timePoint);
+ public Double getNetPoints(Competitor competitor, RaceColumn raceColumn, TimePoint timePoint) throws NoWindException {
+ return getNetPoints(competitor, raceColumn, getRaceColumns(), timePoint);
}
@Override
- public Double getTotalPoints(Competitor competitor, RaceColumn raceColumn,
+ public Double getNetPoints(Competitor competitor, RaceColumn raceColumn,
Iterable raceColumnsToConsider, TimePoint timePoint) throws NoWindException {
final Set discardedRaceColumns = getResultDiscardingRule()
.getDiscardedRaceColumns(competitor, this, raceColumnsToConsider, timePoint);
- return getTotalPoints(competitor, raceColumn, timePoint, discardedRaceColumns);
+ return getNetPoints(competitor, raceColumn, timePoint, discardedRaceColumns);
}
/**
- * Same as {@link #getTotalPoints(Competitor, RaceColumn, Iterable, TimePoint)}, only that the set of discarded race columns can
- * be specified which is useful when total points are to be computed for more than one column for the same
+ * Same as {@link #getNetPoints(Competitor, RaceColumn, Iterable, TimePoint)}, only that the set of discarded race columns can
+ * be specified which is useful when net points are to be computed for more than one column for the same
* competitor because then the calculation of discards (which requires looking at all columns) only needs to be done
* once and not again for each column (which would lead to quadratic effort).
*
@@ -503,28 +503,28 @@ public abstract class AbstractSimpleLeaderboardImpl implements Leaderboard, Race
* getDiscardedRaceColumns(competitor, this, raceColumnsToConsider, timePoint)}.
*/
@Override
- public Double getTotalPoints(Competitor competitor, RaceColumn raceColumn, TimePoint timePoint, Set discardedRaceColumns) {
+ public Double getNetPoints(Competitor competitor, RaceColumn raceColumn, TimePoint timePoint, Set discardedRaceColumns) {
Double result;
if (isDiscarded(competitor, raceColumn, timePoint, discardedRaceColumns)) {
result = 0.0;
} else {
- final Double netPoints = getNetPoints(competitor, raceColumn, timePoint);
- if (netPoints == null) {
+ final Double totalPoints = getTotalPoints(competitor, raceColumn, timePoint);
+ if (totalPoints == null) {
result = null;
} else {
- result = raceColumn.getFactor() * netPoints;
+ result = raceColumn.getFactor() * totalPoints;
}
}
return result;
}
@Override
- public Double getTotalPoints(Competitor competitor, TimePoint timePoint) {
- return getTotalPoints(competitor, getRaceColumns(), timePoint);
+ public Double getNetPoints(Competitor competitor, TimePoint timePoint) {
+ return getNetPoints(competitor, getRaceColumns(), timePoint);
}
@Override
- public Double getTotalPoints(Competitor competitor, final Iterable raceColumnsToConsider,
+ public Double getNetPoints(Competitor competitor, final Iterable raceColumnsToConsider,
TimePoint timePoint) {
// when a column with isStartsWithZeroScore() is found, only reset score if the competitor scored in any race from there on
boolean needToResetScoreUponNextNonEmptyEntry = false;
@@ -535,14 +535,14 @@ public abstract class AbstractSimpleLeaderboardImpl implements Leaderboard, Race
if (raceColumn.isStartsWithZeroScore()) {
needToResetScoreUponNextNonEmptyEntry = true;
}
- if (getScoringScheme().isValidInTotalScore(this, raceColumn, competitor, timePoint)) {
- final Double totalPoints = getTotalPoints(competitor, raceColumn, timePoint, discardedRaceColumns);
- if (totalPoints != null) {
+ if (getScoringScheme().isValidInNetScore(this, raceColumn, competitor, timePoint)) {
+ final Double netPoints = getNetPoints(competitor, raceColumn, timePoint, discardedRaceColumns);
+ if (netPoints != null) {
if (needToResetScoreUponNextNonEmptyEntry) {
result = 0;
needToResetScoreUponNextNonEmptyEntry = false;
}
- result += totalPoints;
+ result += netPoints;
}
}
}
@@ -550,19 +550,19 @@ public abstract class AbstractSimpleLeaderboardImpl implements Leaderboard, Race
}
/**
- * All competitors with non-null net points are added to the result which is then sorted by net points in ascending
- * order. The fleet, if ordered, is the primary ordering criterion, followed by the net points.
+ * All competitors with non-null total points are added to the result which is then sorted by total points in ascending
+ * order. The fleet, if ordered, is the primary ordering criterion, followed by the total points.
*/
@Override
public List getCompetitorsFromBestToWorst(final RaceColumn raceColumn, TimePoint timePoint) throws NoWindException {
- final Map> netPointsAndFleet = new HashMap>();
+ final Map> totalPointsAndFleet = new HashMap>();
for (Competitor competitor : getCompetitors()) {
- Double netPoints = getNetPoints(competitor, raceColumn, timePoint);
- if (netPoints != null) {
- netPointsAndFleet.put(competitor, new com.sap.sse.common.Util.Pair(netPoints, raceColumn.getFleetOfCompetitor(competitor)));
+ Double totalPoints = getTotalPoints(competitor, raceColumn, timePoint);
+ if (totalPoints != null) {
+ totalPointsAndFleet.put(competitor, new com.sap.sse.common.Util.Pair(totalPoints, raceColumn.getFleetOfCompetitor(competitor)));
}
}
- List result = new ArrayList(netPointsAndFleet.keySet());
+ List result = new ArrayList(totalPointsAndFleet.keySet());
Collections.sort(result, new Comparator() {
@Override
public int compare(Competitor o1, Competitor o2) {
@@ -573,8 +573,8 @@ public abstract class AbstractSimpleLeaderboardImpl implements Leaderboard, Race
if (raceColumn.hasSplitFleets() && !raceColumn.hasSplitFleetContiguousScoring()) {
// only check fleets if there are more than one and the column is not to be contiguously scored even in case
// of split fleets
- final Fleet o1Fleet = netPointsAndFleet.get(o1).getB();
- final Fleet o2Fleet = netPointsAndFleet.get(o2).getB();
+ final Fleet o1Fleet = totalPointsAndFleet.get(o1).getB();
+ final Fleet o2Fleet = totalPointsAndFleet.get(o2).getB();
if (o1Fleet == null) {
if (o2Fleet == null) {
comparisonResult = 0;
@@ -596,7 +596,7 @@ public abstract class AbstractSimpleLeaderboardImpl implements Leaderboard, Race
}
if (comparisonResult == 0) {
comparisonResult = getScoringScheme().getScoreComparator(/* nullScoresAreBetter */ false).compare(
- netPointsAndFleet.get(o1).getA(), netPointsAndFleet.get(o2).getA());
+ totalPointsAndFleet.get(o1).getA(), totalPointsAndFleet.get(o2).getA());
}
}
return comparisonResult;
@@ -654,7 +654,7 @@ public abstract class AbstractSimpleLeaderboardImpl implements Leaderboard, Race
@Override
public boolean countRaceForComparisonWithDiscardingThresholds(Competitor competitor, RaceColumn raceColumn, TimePoint timePoint) {
TrackedRace trackedRaceForCompetitorInColumn;
- return getScoringScheme().isValidInTotalScore(this, raceColumn, competitor, timePoint) &&
+ return getScoringScheme().isValidInNetScore(this, raceColumn, competitor, timePoint) &&
(getScoreCorrection().isScoreCorrected(competitor, raceColumn, timePoint) ||
((trackedRaceForCompetitorInColumn=raceColumn.getTrackedRace(competitor)) != null &&
trackedRaceForCompetitorInColumn.hasStarted(timePoint) &&
@@ -703,7 +703,7 @@ public abstract class AbstractSimpleLeaderboardImpl implements Leaderboard, Race
}
@Override
- public Map> getTotalPointsSumAfterRaceColumn(final TimePoint timePoint)
+ public Map> getNetPointsSumAfterRaceColumn(final TimePoint timePoint)
throws NoWindException {
final Map> result = new LinkedHashMap<>();
List raceColumnsToConsider = new ArrayList<>();
@@ -714,12 +714,12 @@ public abstract class AbstractSimpleLeaderboardImpl implements Leaderboard, Race
futures.put(raceColumn, executor.submit(new Callable