mirror of
https://github.com/eclipse-sailing-analytics/sailing-analytics.git
synced 2026-10-25 05:23:51 +00:00
finished OneDesignRankingMetric implementation of getTimeToImprove
This commit is contained in:
1 parent
41d8ad28b5
commit
1cbd2646cc
2 files changed
+4
-5
No files matched your search
+3
-4
@@ -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;
|
||||
}
|
||||
|
||||
+1
-1
@@ -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.
|
||||
*/
|
||||
|
||||
Reference in new issue
Block a user