finished OneDesignRankingMetric implementation of getTimeToImprove

This commit is contained in:
Axel Uhl committed 2015-04-21 10:12:19 +02:00
1 parent 41d8ad28b5
commit 1cbd2646cc
2 files changed
+4 -5

No files matched your search

@@ -32,10 +32,9 @@ public class OneDesignRankingMetric implements RankingMetric<Distance> {
public Duration getTimeToImprove(TrackedRace trackedRace, Competitor trailing, Competitor leading,
TimePoint timePoint, WindLegTypeAndLegBearingCache cache) {
final Duration result;
// TODO find the last leg both competitors have already started and compute the gap in that leg;
final TrackedLegOfCompetitor tlocTrailing = null;
if (tlocTrailing != null) {
result = tlocTrailing.getGapToLeader(timePoint, leading, WindPositionMode.LEG_MIDDLE, cache);
final TrackedLegOfCompetitor currentLeg = trackedRace.getCurrentLeg(trailing, timePoint);
if (currentLeg != null) {
result = currentLeg.getGapToLeader(timePoint, leading, WindPositionMode.LEG_MIDDLE, cache);
} else {
result = null;
}
@@ -167,7 +167,7 @@ public interface TrackedLegOfCompetitor extends Serializable {
Duration getGapToLeader(TimePoint timePoint, Competitor leaderInLegAtTimePoint, WindPositionMode windPositionMode) throws NoWindException;
/**
* Same as {@link #getGapToLeaderInSeconds(TimePoint, Competitor)}, only that an additional cache is used
* Same as {@link #getGapToLeader(TimePoint, Competitor, WindPositionMode)}, only that an additional cache is used
* to avoid redundant evaluations of leg types and wind field information across various calculations that
* all can use the same basic information.
*/