mirror of
https://github.com/eclipse-sailing-analytics/sailing-analytics.git
synced 2026-10-30 15:57:11 +00:00
switched from "windward distance to leader" to "windward distance to competitor farthest ahead"
This commit is contained in:
1 parent
f522527d65
commit
9c5bf2c3b1
27 files changed
+94
-91
No files matched your search
+2
-2
@@ -24,9 +24,9 @@ public enum DetailType implements Serializable {
|
||||
AVERAGE_ABSOLUTE_CROSS_TRACK_ERROR_IN_METERS(0, ASCENDING), AVERAGE_SIGNED_CROSS_TRACK_ERROR_IN_METERS(0, ASCENDING), RACE_DISTANCE_TRAVELED(0, ASCENDING),
|
||||
RACE_DISTANCE_TRAVELED_INCLUDING_GATE_START(0, ASCENDING),
|
||||
RACE_AVERAGE_SPEED_OVER_GROUND_IN_KNOTS(2, DESCENDING), RACE_GAP_TO_LEADER_IN_SECONDS(0, ASCENDING),
|
||||
RACE_DISTANCE_TO_LEADER_IN_METERS(0, ASCENDING), RACE_AVERAGE_ABSOLUTE_CROSS_TRACK_ERROR_IN_METERS(0, ASCENDING),
|
||||
RACE_DISTANCE_TO_COMPETITOR_FARTHEST_AHEAD_IN_METERS(0, ASCENDING), RACE_AVERAGE_ABSOLUTE_CROSS_TRACK_ERROR_IN_METERS(0, ASCENDING),
|
||||
RACE_AVERAGE_SIGNED_CROSS_TRACK_ERROR_IN_METERS(0, ASCENDING),
|
||||
WINDWARD_DISTANCE_TO_OVERALL_LEADER(0, ASCENDING), START_TACK(0, ASCENDING), DISTANCE_TO_START_AT_RACE_START(1, ASCENDING),
|
||||
WINDWARD_DISTANCE_TO_COMPETITOR_FARTHEST_AHEAD(0, ASCENDING), START_TACK(0, ASCENDING), DISTANCE_TO_START_AT_RACE_START(1, ASCENDING),
|
||||
TIME_BETWEEN_RACE_START_AND_COMPETITOR_START(1, ASCENDING),
|
||||
SPEED_OVER_GROUND_AT_RACE_START(1, DESCENDING), SPEED_OVER_GROUND_WHEN_PASSING_START(1, DESCENDING),
|
||||
DISTANCE_TO_STARBOARD_END_OF_STARTLINE_WHEN_PASSING_START_IN_METERS(1, ASCENDING),
|
||||
|
||||
+5
-5
@@ -42,7 +42,7 @@ public class LeaderboardEntryDTO implements Serializable {
|
||||
|
||||
public boolean discarded;
|
||||
|
||||
public Double windwardDistanceToOverallLeaderInMeters;
|
||||
public Double windwardDistanceToCompetitorFarthestAheadInMeters;
|
||||
|
||||
public Double averageAbsoluteCrossTrackErrorInMeters;
|
||||
|
||||
@@ -179,7 +179,7 @@ public class LeaderboardEntryDTO implements Serializable {
|
||||
result = prime * result + ((totalPoints == null) ? 0 : totalPoints.hashCode());
|
||||
result = prime
|
||||
* result
|
||||
+ ((windwardDistanceToOverallLeaderInMeters == null) ? 0 : windwardDistanceToOverallLeaderInMeters
|
||||
+ ((windwardDistanceToCompetitorFarthestAheadInMeters == null) ? 0 : windwardDistanceToCompetitorFarthestAheadInMeters
|
||||
.hashCode());
|
||||
return result;
|
||||
}
|
||||
@@ -297,10 +297,10 @@ public class LeaderboardEntryDTO implements Serializable {
|
||||
return false;
|
||||
} else if (!totalPoints.equals(other.totalPoints))
|
||||
return false;
|
||||
if (windwardDistanceToOverallLeaderInMeters == null) {
|
||||
if (other.windwardDistanceToOverallLeaderInMeters != null)
|
||||
if (windwardDistanceToCompetitorFarthestAheadInMeters == null) {
|
||||
if (other.windwardDistanceToCompetitorFarthestAheadInMeters != null)
|
||||
return false;
|
||||
} else if (!windwardDistanceToOverallLeaderInMeters.equals(other.windwardDistanceToOverallLeaderInMeters))
|
||||
} else if (!windwardDistanceToCompetitorFarthestAheadInMeters.equals(other.windwardDistanceToCompetitorFarthestAheadInMeters))
|
||||
return false;
|
||||
return true;
|
||||
}
|
||||
|
||||
+11
-11
@@ -194,8 +194,8 @@ public class ReachingLegTest extends TrackBasedTest {
|
||||
assertEquals(0.,
|
||||
getTrackedRace().getTrack(plattner).getEstimatedPosition(timePointInReaching, /* extrapolate */false)
|
||||
.getDistance(windwardMarkPos).getMeters(), 0.00001);
|
||||
Distance hungersDistanceToLeader = getTrackedRace().getWindwardDistanceToOverallLeader(hunger, timePointInReaching, WindPositionMode.LEG_MIDDLE);
|
||||
Distance plattnersDistanceToLeader = getTrackedRace().getWindwardDistanceToOverallLeader(plattner, timePointInReaching, WindPositionMode.LEG_MIDDLE);
|
||||
Distance hungersDistanceToLeader = getTrackedRace().getWindwardDistanceToCompetitorFarthestAhead(hunger, timePointInReaching, WindPositionMode.LEG_MIDDLE);
|
||||
Distance plattnersDistanceToLeader = getTrackedRace().getWindwardDistanceToCompetitorFarthestAhead(plattner, timePointInReaching, WindPositionMode.LEG_MIDDLE);
|
||||
assertEquals(0., hungersDistanceToLeader.getMeters(), 0.00001);
|
||||
assertEquals(distanceOfReachingLeg.getMeters(), plattnersDistanceToLeader.getMeters(), 0.001);
|
||||
}
|
||||
@@ -224,8 +224,8 @@ public class ReachingLegTest extends TrackBasedTest {
|
||||
assertEquals(0.,
|
||||
getTrackedRace().getTrack(plattner).getEstimatedPosition(timePointInReaching, /* extrapolate */false)
|
||||
.getDistance(windwardMarkPos).getMeters(), 0.00001);
|
||||
Distance hungersDistanceToLeader = getTrackedRace().getWindwardDistanceToOverallLeader(hunger, timePointInReaching, WindPositionMode.LEG_MIDDLE);
|
||||
Distance plattnersDistanceToLeader = getTrackedRace().getWindwardDistanceToOverallLeader(plattner, timePointInReaching, WindPositionMode.LEG_MIDDLE);
|
||||
Distance hungersDistanceToLeader = getTrackedRace().getWindwardDistanceToCompetitorFarthestAhead(hunger, timePointInReaching, WindPositionMode.LEG_MIDDLE);
|
||||
Distance plattnersDistanceToLeader = getTrackedRace().getWindwardDistanceToCompetitorFarthestAhead(plattner, timePointInReaching, WindPositionMode.LEG_MIDDLE);
|
||||
assertEquals(0., hungersDistanceToLeader.getMeters(), 0.00001);
|
||||
assertEquals(distanceOfReachingLeg.getMeters(), plattnersDistanceToLeader.getMeters(), 0.001);
|
||||
}
|
||||
@@ -254,8 +254,8 @@ public class ReachingLegTest extends TrackBasedTest {
|
||||
assertEquals(0.,
|
||||
getTrackedRace().getTrack(plattner).getEstimatedPosition(timePointInReaching, /* extrapolate */false)
|
||||
.getDistance(windwardMarkPos).getMeters(), 0.00001);
|
||||
Distance hungersDistanceToLeader = getTrackedRace().getWindwardDistanceToOverallLeader(hunger, timePointInReaching, WindPositionMode.LEG_MIDDLE);
|
||||
Distance plattnersDistanceToLeader = getTrackedRace().getWindwardDistanceToOverallLeader(plattner, timePointInReaching, WindPositionMode.LEG_MIDDLE);
|
||||
Distance hungersDistanceToLeader = getTrackedRace().getWindwardDistanceToCompetitorFarthestAhead(hunger, timePointInReaching, WindPositionMode.LEG_MIDDLE);
|
||||
Distance plattnersDistanceToLeader = getTrackedRace().getWindwardDistanceToCompetitorFarthestAhead(plattner, timePointInReaching, WindPositionMode.LEG_MIDDLE);
|
||||
assertEquals(0., hungersDistanceToLeader.getMeters(), 0.00001);
|
||||
assertEquals(distanceOfReachingLeg.getMeters(), plattnersDistanceToLeader.getMeters(), 0.001);
|
||||
}
|
||||
@@ -289,8 +289,8 @@ public class ReachingLegTest extends TrackBasedTest {
|
||||
assertEquals(0.,
|
||||
getTrackedRace().getTrack(plattner).getEstimatedPosition(timePointToConsider, /* extrapolate */false)
|
||||
.getDistance(leewardPos).getMeters(), 0.00001);
|
||||
Distance hungersDistanceToLeader = getTrackedRace().getWindwardDistanceToOverallLeader(hunger, timePointToConsider, WindPositionMode.LEG_MIDDLE);
|
||||
Distance plattnersDistanceToLeader = getTrackedRace().getWindwardDistanceToOverallLeader(plattner, timePointToConsider, WindPositionMode.LEG_MIDDLE);
|
||||
Distance hungersDistanceToLeader = getTrackedRace().getWindwardDistanceToCompetitorFarthestAhead(hunger, timePointToConsider, WindPositionMode.LEG_MIDDLE);
|
||||
Distance plattnersDistanceToLeader = getTrackedRace().getWindwardDistanceToCompetitorFarthestAhead(plattner, timePointToConsider, WindPositionMode.LEG_MIDDLE);
|
||||
assertEquals(0., hungersDistanceToLeader.getMeters(), 0.00001);
|
||||
assertEquals(distanceOfReachingLeg.getMeters()+windwardDistanceOfUpwindLeg.getMeters(), plattnersDistanceToLeader.getMeters(), 0.001);
|
||||
}
|
||||
@@ -333,8 +333,8 @@ public class ReachingLegTest extends TrackBasedTest {
|
||||
assertEquals(0.,
|
||||
getTrackedRace().getTrack(plattner).getEstimatedPosition(timePointToConsider, /* extrapolate */false)
|
||||
.getDistance(leewardPos).getMeters(), 0.00001);
|
||||
Distance schomaekersDistanceToLeader = getTrackedRace().getWindwardDistanceToOverallLeader(schomaeker, timePointToConsider, WindPositionMode.LEG_MIDDLE);
|
||||
Distance plattnersDistanceToLeader = getTrackedRace().getWindwardDistanceToOverallLeader(plattner, timePointToConsider, WindPositionMode.LEG_MIDDLE);
|
||||
Distance schomaekersDistanceToLeader = getTrackedRace().getWindwardDistanceToCompetitorFarthestAhead(schomaeker, timePointToConsider, WindPositionMode.LEG_MIDDLE);
|
||||
Distance plattnersDistanceToLeader = getTrackedRace().getWindwardDistanceToCompetitorFarthestAhead(plattner, timePointToConsider, WindPositionMode.LEG_MIDDLE);
|
||||
assertEquals(0., schomaekersDistanceToLeader.getMeters(), 0.00001);
|
||||
// distance to leading Schomaeker expected to be the entire upwind distance plus the offset distance plus half the downwind
|
||||
assertEquals(distanceOfReachingLeg.getMeters()+windwardDistanceOfUpwindLeg.getMeters()*1.5, plattnersDistanceToLeader.getMeters(), 0.001);
|
||||
@@ -374,7 +374,7 @@ public class ReachingLegTest extends TrackBasedTest {
|
||||
getTrackedRace().getTrack(plattner).getEstimatedPosition(timePointToConsider, /* extrapolate */
|
||||
false)).getMeters(), 0.00001);
|
||||
// however, projected onto the leg their distance should be 0
|
||||
Distance plattnersDistanceToLeader = getTrackedRace().getWindwardDistanceToOverallLeader(plattner, timePointToConsider, WindPositionMode.LEG_MIDDLE);
|
||||
Distance plattnersDistanceToLeader = getTrackedRace().getWindwardDistanceToCompetitorFarthestAhead(plattner, timePointToConsider, WindPositionMode.LEG_MIDDLE);
|
||||
assertEquals(0., plattnersDistanceToLeader.getMeters(), 0.00001);
|
||||
}
|
||||
}
|
||||
+2
-2
@@ -565,7 +565,7 @@ public class MockedTrackedRace implements DynamicTrackedRace {
|
||||
}
|
||||
|
||||
@Override
|
||||
public Distance getWindwardDistanceToOverallLeader(Competitor competitor, TimePoint timePoint, WindPositionMode windPositionMode) {
|
||||
public Distance getWindwardDistanceToCompetitorFarthestAhead(Competitor competitor, TimePoint timePoint, WindPositionMode windPositionMode) {
|
||||
return null;
|
||||
}
|
||||
|
||||
@@ -936,7 +936,7 @@ public class MockedTrackedRace implements DynamicTrackedRace {
|
||||
}
|
||||
|
||||
@Override
|
||||
public Distance getWindwardDistanceToOverallLeader(Competitor competitor, TimePoint timePoint,
|
||||
public Distance getWindwardDistanceToCompetitorFarthestAhead(Competitor competitor, TimePoint timePoint,
|
||||
WindPositionMode windPositionMode, RankingInfo rankingInfo, WindLegTypeAndLegBearingCache cache) {
|
||||
return null;
|
||||
}
|
||||
|
||||
+2
-2
@@ -346,7 +346,7 @@ public class MockedTrackedRaceWithStartTimeAndRanks implements TrackedRace {
|
||||
}
|
||||
|
||||
@Override
|
||||
public Distance getWindwardDistanceToOverallLeader(Competitor competitor, TimePoint timePoint, WindPositionMode windPositionMode) {
|
||||
public Distance getWindwardDistanceToCompetitorFarthestAhead(Competitor competitor, TimePoint timePoint, WindPositionMode windPositionMode) {
|
||||
return null;
|
||||
}
|
||||
|
||||
@@ -612,7 +612,7 @@ public class MockedTrackedRaceWithStartTimeAndRanks implements TrackedRace {
|
||||
}
|
||||
|
||||
@Override
|
||||
public Distance getWindwardDistanceToOverallLeader(Competitor competitor, TimePoint timePoint,
|
||||
public Distance getWindwardDistanceToCompetitorFarthestAhead(Competitor competitor, TimePoint timePoint,
|
||||
WindPositionMode windPositionMode, RankingInfo rankingInfo, WindLegTypeAndLegBearingCache cache) {
|
||||
return null;
|
||||
}
|
||||
|
||||
+10
-10
@@ -1392,8 +1392,8 @@ public abstract class AbstractSimpleLeaderboardImpl implements Leaderboard, Race
|
||||
RaceDetails raceDetails = getRaceDetails(trackedRace, competitor, timePoint, waitForLatestAnalyses,
|
||||
legRanksCache, rankingInfo, cache);
|
||||
entryDTO.legDetails = raceDetails.getLegDetails();
|
||||
entryDTO.windwardDistanceToOverallLeaderInMeters = raceDetails.getWindwardDistanceToOverallLeader() == null ? null
|
||||
: raceDetails.getWindwardDistanceToOverallLeader().getMeters();
|
||||
entryDTO.windwardDistanceToCompetitorFarthestAheadInMeters = raceDetails.getWindwardDistanceToCompetitorFarthestAhead() == null ? null
|
||||
: raceDetails.getWindwardDistanceToCompetitorFarthestAhead().getMeters();
|
||||
entryDTO.gapToLeaderInOwnTime = trackedRace.getRankingMetric().getGapToLeaderInOwnTime(rankingInfo, competitor, cache);
|
||||
entryDTO.averageAbsoluteCrossTrackErrorInMeters = raceDetails.getAverageAbsoluteCrossTrackError() == null ? null
|
||||
: raceDetails.getAverageAbsoluteCrossTrackError().getMeters();
|
||||
@@ -1481,20 +1481,20 @@ public abstract class AbstractSimpleLeaderboardImpl implements Leaderboard, Race
|
||||
|
||||
private static class RaceDetails {
|
||||
private final List<LegEntryDTO> legDetails;
|
||||
private final Distance windwardDistanceToOverallLeader;
|
||||
private final Distance windwardDistanceToCompetitorFarthestAhead;
|
||||
private final Distance averageAbsoluteCrossTrackError;
|
||||
private final Distance averageSignedCrossTrackError;
|
||||
private final Duration gapToLeaderInOwnTime;
|
||||
private final Duration correctedTime;
|
||||
private final Duration correctedTimeAtEstimatedArrivalAtCompetitorFarthestAhead;
|
||||
|
||||
public RaceDetails(List<LegEntryDTO> legDetails, Distance windwardDistanceToOverallLeader,
|
||||
public RaceDetails(List<LegEntryDTO> legDetails, Distance windwardDistanceToCompetitorFarthestAhead,
|
||||
Distance averageAbsoluteCrossTrackError, Distance averageSignedCrossTrackError,
|
||||
Duration gapToLeaderInOwnTime, Duration correctedTime,
|
||||
Duration correctedTimeAtEstimatedArrivalAtCompetitorFarthestAhead) {
|
||||
super();
|
||||
this.legDetails = legDetails;
|
||||
this.windwardDistanceToOverallLeader = windwardDistanceToOverallLeader;
|
||||
this.windwardDistanceToCompetitorFarthestAhead = windwardDistanceToCompetitorFarthestAhead;
|
||||
this.averageAbsoluteCrossTrackError = averageAbsoluteCrossTrackError;
|
||||
this.averageSignedCrossTrackError = averageSignedCrossTrackError;
|
||||
this.gapToLeaderInOwnTime = gapToLeaderInOwnTime;
|
||||
@@ -1504,8 +1504,8 @@ public abstract class AbstractSimpleLeaderboardImpl implements Leaderboard, Race
|
||||
public List<LegEntryDTO> getLegDetails() {
|
||||
return legDetails;
|
||||
}
|
||||
public Distance getWindwardDistanceToOverallLeader() {
|
||||
return windwardDistanceToOverallLeader;
|
||||
public Distance getWindwardDistanceToCompetitorFarthestAhead() {
|
||||
return windwardDistanceToCompetitorFarthestAhead;
|
||||
}
|
||||
public Distance getAverageAbsoluteCrossTrackError() {
|
||||
return averageAbsoluteCrossTrackError;
|
||||
@@ -1599,8 +1599,8 @@ public abstract class AbstractSimpleLeaderboardImpl implements Leaderboard, Race
|
||||
}
|
||||
legDetails.add(legEntry);
|
||||
}
|
||||
final Distance windwardDistanceToOverallLeader = trackedRace == null ? null : trackedRace
|
||||
.getWindwardDistanceToOverallLeader(competitor, timePoint, WindPositionMode.LEG_MIDDLE, rankingInfo, cache);
|
||||
final Distance windwardDistanceToCompetitorFarthestAhead = trackedRace == null ? null : trackedRace
|
||||
.getWindwardDistanceToCompetitorFarthestAhead(competitor, timePoint, WindPositionMode.LEG_MIDDLE, rankingInfo, cache);
|
||||
Distance averageAbsoluteCrossTrackError;
|
||||
try {
|
||||
averageAbsoluteCrossTrackError = trackedRace == null ? null : trackedRace.getAverageAbsoluteCrossTrackError(
|
||||
@@ -1617,7 +1617,7 @@ public abstract class AbstractSimpleLeaderboardImpl implements Leaderboard, Race
|
||||
// without wind information, use null meaning "unknown"
|
||||
averageSignedCrossTrackError = null;
|
||||
}
|
||||
return new RaceDetails(legDetails, windwardDistanceToOverallLeader, averageAbsoluteCrossTrackError, averageSignedCrossTrackError,
|
||||
return new RaceDetails(legDetails, windwardDistanceToCompetitorFarthestAhead, averageAbsoluteCrossTrackError, averageSignedCrossTrackError,
|
||||
trackedRace.getRankingMetric().getGapToLeaderInOwnTime(rankingInfo, competitor, cache),
|
||||
trackedRace.getRankingMetric().getCorrectedTime(competitor, timePoint),
|
||||
rankingInfo.getCompetitorRankingInfo().apply(competitor).getCorrectedTimeAtEstimatedArrivalAtCompetitorFarthestAhead());
|
||||
|
||||
+3
-3
@@ -236,14 +236,14 @@ public interface TrackedLegOfCompetitor extends Serializable {
|
||||
*
|
||||
* @param rankingInfo materialized ranking information that is pre-calculated to avoid expensive redundant work
|
||||
*/
|
||||
Distance getWindwardDistanceToOverallLeader(TimePoint timePoint, WindPositionMode windPositionMode, RankingInfo rankingInfo);
|
||||
Distance getWindwardDistanceToCompetitorFarthestAhead(TimePoint timePoint, WindPositionMode windPositionMode, RankingInfo rankingInfo);
|
||||
|
||||
/**
|
||||
* Same as {@link #getWindwardDistanceToOverallLeader(TimePoint, WindPositionMode, RankingInfo)}, only that a cache for leg type
|
||||
* Same as {@link #getWindwardDistanceToCompetitorFarthestAhead(TimePoint, WindPositionMode, RankingInfo)}, only that a cache for leg type
|
||||
* calculation is passed.
|
||||
* @param rankingInfo TODO
|
||||
*/
|
||||
Distance getWindwardDistanceToOverallLeader(TimePoint timePoint, WindPositionMode windPositionMode, RankingInfo rankingInfo, WindLegTypeAndLegBearingCache cache);
|
||||
Distance getWindwardDistanceToCompetitorFarthestAhead(TimePoint timePoint, WindPositionMode windPositionMode, RankingInfo rankingInfo, WindLegTypeAndLegBearingCache cache);
|
||||
|
||||
/**
|
||||
* Computes the average absolute cross track error for this leg. The cross track error for each fix is taken to be a
|
||||
|
||||
@@ -516,20 +516,21 @@ public interface TrackedRace extends Serializable {
|
||||
Distance getDistanceTraveledIncludingGateStart(Competitor competitor, TimePoint timePoint);
|
||||
|
||||
/**
|
||||
* See {@link TrackedLegOfCompetitor#getWindwardDistanceToOverallLeader(TimePoint, WindPositionMode, RankingInfo)}
|
||||
* See {@link TrackedLegOfCompetitor#getWindwardDistanceToCompetitorFarthestAhead(TimePoint, WindPositionMode, RankingInfo)}
|
||||
*/
|
||||
Distance getWindwardDistanceToOverallLeader(Competitor competitor, TimePoint timePoint, WindPositionMode windPositionMode);
|
||||
Distance getWindwardDistanceToCompetitorFarthestAhead(Competitor competitor, TimePoint timePoint, WindPositionMode windPositionMode);
|
||||
|
||||
/**
|
||||
* Same as {@link #getWindwardDistanceToOverallLeader(Competitor, TimePoint, WindPositionMode)}, only with an
|
||||
* Same as {@link #getWindwardDistanceToCompetitorFarthestAhead(Competitor, TimePoint, WindPositionMode)}, only with an
|
||||
* additional cache to speed up wind and leg type and leg bearing calculations in case of multiple similar look-ups
|
||||
* for the same time point.
|
||||
*
|
||||
* @param rankingInfo
|
||||
* materialized ranking information that is expensive to calculate, avoiding redundant calculations
|
||||
*/
|
||||
Distance getWindwardDistanceToOverallLeader(Competitor competitor, TimePoint timePoint, WindPositionMode windPositionMode, RankingInfo rankingInfo, WindLegTypeAndLegBearingCache cache);
|
||||
|
||||
Distance getWindwardDistanceToCompetitorFarthestAhead(Competitor competitor, TimePoint timePoint,
|
||||
WindPositionMode windPositionMode, RankingInfo rankingInfo, WindLegTypeAndLegBearingCache cache);
|
||||
|
||||
/**
|
||||
* Calls {@link #getWindWithConfidence(Position, TimePoint, Iterable)} and excludes those wind sources listed in
|
||||
* {@link #getWindSourcesToExclude}.
|
||||
|
||||
+6
-6
@@ -407,17 +407,17 @@ public class TrackedLegOfCompetitorImpl implements TrackedLegOfCompetitor {
|
||||
}
|
||||
|
||||
@Override
|
||||
public Distance getWindwardDistanceToOverallLeader(TimePoint timePoint, WindPositionMode windPositionMode, final RankingInfo rankingInfo) {
|
||||
return getWindwardDistanceToOverallLeader(timePoint, windPositionMode, rankingInfo, new LeaderboardDTOCalculationReuseCache(timePoint));
|
||||
public Distance getWindwardDistanceToCompetitorFarthestAhead(TimePoint timePoint, WindPositionMode windPositionMode, final RankingInfo rankingInfo) {
|
||||
return getWindwardDistanceToCompetitorFarthestAhead(timePoint, windPositionMode, rankingInfo, new LeaderboardDTOCalculationReuseCache(timePoint));
|
||||
}
|
||||
|
||||
@Override
|
||||
public Distance getWindwardDistanceToOverallLeader(TimePoint timePoint, WindPositionMode windPositionMode, final RankingInfo rankingInfo, WindLegTypeAndLegBearingCache cache) {
|
||||
public Distance getWindwardDistanceToCompetitorFarthestAhead(TimePoint timePoint, WindPositionMode windPositionMode, final RankingInfo rankingInfo, WindLegTypeAndLegBearingCache cache) {
|
||||
// FIXME bug 607 it seems the following fetches the leader of this leg, not the overall leader; validate!!! Use getTrackedRace().getRanks() instead
|
||||
Competitor leader = getTrackedRace().getOverallLeader(timePoint, cache);
|
||||
TrackedLegOfCompetitor leaderLeg = getTrackedRace().getCurrentLeg(leader, timePoint);
|
||||
Competitor competitorFarthestAhead = rankingInfo.getCompetitorFarthestAhead();
|
||||
TrackedLegOfCompetitor leaderLeg = getTrackedRace().getCurrentLeg(competitorFarthestAhead, timePoint);
|
||||
Distance result = null;
|
||||
Position leaderPosition = getTrackedRace().getTrack(leader).getEstimatedPosition(timePoint, /* extrapolate */ false);
|
||||
Position leaderPosition = getTrackedRace().getTrack(competitorFarthestAhead).getEstimatedPosition(timePoint, /* extrapolate */ false);
|
||||
Position currentPosition = getTrackedRace().getTrack(getCompetitor()).getEstimatedPosition(timePoint, /* extrapolate */ false);
|
||||
if (leaderPosition != null && currentPosition != null) {
|
||||
result = Distance.NULL;
|
||||
|
||||
+4
-4
@@ -2870,17 +2870,17 @@ public abstract class TrackedRaceImpl extends TrackedRaceWithWindEssentials impl
|
||||
}
|
||||
|
||||
@Override
|
||||
public Distance getWindwardDistanceToOverallLeader(Competitor competitor, TimePoint timePoint, WindPositionMode windPositionMode) {
|
||||
public Distance getWindwardDistanceToCompetitorFarthestAhead(Competitor competitor, TimePoint timePoint, WindPositionMode windPositionMode) {
|
||||
final TrackedLegOfCompetitor trackedLeg = getTrackedLeg(competitor, timePoint);
|
||||
return trackedLeg == null ? null : trackedLeg.getWindwardDistanceToOverallLeader(timePoint, windPositionMode,
|
||||
return trackedLeg == null ? null : trackedLeg.getWindwardDistanceToCompetitorFarthestAhead(timePoint, windPositionMode,
|
||||
getRankingMetric().getRankingInfo(timePoint));
|
||||
}
|
||||
|
||||
@Override
|
||||
public Distance getWindwardDistanceToOverallLeader(Competitor competitor, TimePoint timePoint,
|
||||
public Distance getWindwardDistanceToCompetitorFarthestAhead(Competitor competitor, TimePoint timePoint,
|
||||
WindPositionMode windPositionMode, RankingInfo rankingInfo, WindLegTypeAndLegBearingCache cache) {
|
||||
final TrackedLegOfCompetitor trackedLeg = getTrackedLeg(competitor, timePoint);
|
||||
return trackedLeg == null ? null : trackedLeg.getWindwardDistanceToOverallLeader(timePoint, windPositionMode, rankingInfo, cache);
|
||||
return trackedLeg == null ? null : trackedLeg.getWindwardDistanceToCompetitorFarthestAhead(timePoint, windPositionMode, rankingInfo, cache);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
+2
-2
@@ -373,7 +373,7 @@ public class MockedTrackedRace implements DynamicTrackedRace {
|
||||
}
|
||||
|
||||
@Override
|
||||
public Distance getWindwardDistanceToOverallLeader(Competitor competitor, TimePoint timePoint, WindPositionMode windPositionMode) {
|
||||
public Distance getWindwardDistanceToCompetitorFarthestAhead(Competitor competitor, TimePoint timePoint, WindPositionMode windPositionMode) {
|
||||
return null;
|
||||
}
|
||||
|
||||
@@ -744,7 +744,7 @@ public class MockedTrackedRace implements DynamicTrackedRace {
|
||||
}
|
||||
|
||||
@Override
|
||||
public Distance getWindwardDistanceToOverallLeader(Competitor competitor, TimePoint timePoint,
|
||||
public Distance getWindwardDistanceToCompetitorFarthestAhead(Competitor competitor, TimePoint timePoint,
|
||||
WindPositionMode windPositionMode, RankingInfo rankingInfo, WindLegTypeAndLegBearingCache cache) {
|
||||
return null;
|
||||
}
|
||||
|
||||
+8
-8
@@ -60,16 +60,16 @@ public class DetailTypeFormatter {
|
||||
return stringMessages.averageSpeedInKnots();
|
||||
case RACE_GAP_TO_LEADER_IN_SECONDS:
|
||||
return stringMessages.gapToLeaderInSeconds();
|
||||
case RACE_DISTANCE_TO_LEADER_IN_METERS:
|
||||
return stringMessages.windwardDistanceToLeaderInMeters();
|
||||
case RACE_DISTANCE_TO_COMPETITOR_FARTHEST_AHEAD_IN_METERS:
|
||||
return stringMessages.windwardDistanceToCompetitorFarthestAheadInMeters();
|
||||
case RACE_AVERAGE_ABSOLUTE_CROSS_TRACK_ERROR_IN_METERS:
|
||||
return stringMessages.averageAbsoluteCrossTrackErrorInMeters();
|
||||
case RACE_AVERAGE_SIGNED_CROSS_TRACK_ERROR_IN_METERS:
|
||||
return stringMessages.averageSignedCrossTrackErrorInMeters();
|
||||
case START_TACK:
|
||||
return stringMessages.startTack();
|
||||
case WINDWARD_DISTANCE_TO_OVERALL_LEADER:
|
||||
return stringMessages.windwardDistanceToLeaderInMeters();
|
||||
case WINDWARD_DISTANCE_TO_COMPETITOR_FARTHEST_AHEAD:
|
||||
return stringMessages.windwardDistanceToCompetitorFarthestAheadInMeters();
|
||||
case DISTANCE_TO_START_AT_RACE_START:
|
||||
return stringMessages.distanceToLineAtRaceStart();
|
||||
case TIME_BETWEEN_RACE_START_AND_COMPETITOR_START:
|
||||
@@ -170,11 +170,11 @@ public class DetailTypeFormatter {
|
||||
case RACE_SPEED_OVER_GROUND_FIVE_SECONDS_BEFORE_START:
|
||||
return stringMessages.knotsUnit();
|
||||
|
||||
case WINDWARD_DISTANCE_TO_OVERALL_LEADER:
|
||||
case WINDWARD_DISTANCE_TO_COMPETITOR_FARTHEST_AHEAD:
|
||||
case WINDWARD_DISTANCE_TO_GO_IN_METERS:
|
||||
case DISTANCE_TRAVELED:
|
||||
case DISTANCE_TRAVELED_INCLUDING_GATE_START:
|
||||
case RACE_DISTANCE_TO_LEADER_IN_METERS:
|
||||
case RACE_DISTANCE_TO_COMPETITOR_FARTHEST_AHEAD_IN_METERS:
|
||||
case RACE_DISTANCE_TRAVELED:
|
||||
case RACE_DISTANCE_TRAVELED_INCLUDING_GATE_START:
|
||||
case AVERAGE_TACK_LOSS_IN_METERS:
|
||||
@@ -304,9 +304,9 @@ public class DetailTypeFormatter {
|
||||
return stringMessages.currentOrAverageSpeedOverGroundInKnotsTooltip();
|
||||
case RACE_CURRENT_SPEED_OVER_GROUND_IN_KNOTS:
|
||||
return stringMessages.currentSpeedOverGroundInKnotsTooltip();
|
||||
case RACE_DISTANCE_TO_LEADER_IN_METERS:
|
||||
case RACE_DISTANCE_TO_COMPETITOR_FARTHEST_AHEAD_IN_METERS:
|
||||
return stringMessages.windwardDistanceToLeaderInMetersTooltip();
|
||||
case WINDWARD_DISTANCE_TO_OVERALL_LEADER:
|
||||
case WINDWARD_DISTANCE_TO_COMPETITOR_FARTHEST_AHEAD:
|
||||
return stringMessages.windwardDistanceToLeaderInMetersTooltip();
|
||||
case DISTANCE_TO_START_AT_RACE_START:
|
||||
return stringMessages.distanceToLineAtRaceStartTooltip();
|
||||
|
||||
+1
-1
@@ -93,7 +93,7 @@ public interface StringMessages extends com.sap.sse.gwt.client.StringMessages, c
|
||||
String gapToLeaderInSeconds();
|
||||
String velocityMadeGoodInKnots();
|
||||
String windwardDistanceToGoInMeters();
|
||||
String windwardDistanceToLeaderInMeters();
|
||||
String windwardDistanceToCompetitorFarthestAheadInMeters();
|
||||
String name();
|
||||
String leaveEmptyForDefault();
|
||||
String trackNewEvent();
|
||||
|
||||
+2
-2
@@ -91,8 +91,8 @@ velocityMadeGoodInKnots=VMG
|
||||
velocityMadeGoodInKnotsTooltip=The velocity made good, which is the windward/leeward speed for upwind/downwind legs, respectively, or the along-track speed for reaching legs.
|
||||
windwardDistanceToGoInMeters=Windward distance to go
|
||||
windwardDistanceToGoInMetersTooltip=Windward/leeward distance from the competitor''s current position to the end of the leg for upwind/downwind legs, respectively, or the along-track distance for reaching legs.
|
||||
windwardDistanceToLeaderInMeters=Windward Distance To Leader
|
||||
windwardDistanceToLeaderInMetersTooltip=Windward/leeward distance of the competitor to the leader for upwind/downwind legs, respectively, or the along-track distance for reaching legs.
|
||||
windwardDistanceToCompetitorFarthestAheadInMeters=Windward Distance To Competitor Farthest Ahead
|
||||
windwardDistanceToCompetitorFarthestAheadInMeters=Windward/leeward distance of the competitor to the competitor farthest ahead in the race for upwind/downwind legs, respectively, or the along-track distance for reaching legs.\nNote that the competitor that is farthest ahead is not necessarily leading the race if handicap ranking is in place.
|
||||
name=Name
|
||||
leaveEmptyForDefault=Leave empty for default
|
||||
trackNewEvent=Track New event
|
||||
|
||||
+2
-2
@@ -812,7 +812,7 @@ papaRemoved=Start mode flag - one minute till start
|
||||
showDiagram=显示图表
|
||||
dontoverwrite=Don''t overwrite
|
||||
storedData=Stored data
|
||||
windwardDistanceToLeaderInMeters=迎风航段时离开上风第一名的平行距离
|
||||
windwardDistanceToCompetitorFarthestAheadInMeters=迎风航段时离开上风第一名的平行距离
|
||||
hostname=Hostname
|
||||
distanceIncludingGateStartInMeters=距离(起航门标)
|
||||
valueForCompetitorAt={0} at {1}: {2}
|
||||
@@ -827,7 +827,7 @@ windChart=Wind Chart
|
||||
events=活动
|
||||
racesAreLive=Races {0} are live
|
||||
operatorNotContains=Not Contains
|
||||
windwardDistanceToLeaderInMetersTooltip=迎/顺风航段时离开上风/下风第一名的平行距离或横风时的实际距离name 名字
|
||||
windwardDistanceToCompetitorFarthestAheadInMetersTooltip=迎/顺风航段时离开上风/下风第一名的平行距离或横风时的实际距离name 名字
|
||||
errorAddingResultImportUrl=Error adding result import URL: {0}
|
||||
noGrouperSelectedError=No grouper type is selected
|
||||
leaderboardsExceptFromSelectedGroup=Leaderboards (except those of selected group)
|
||||
|
||||
+2
-2
@@ -91,8 +91,8 @@ velocityMadeGoodInKnots=VMG
|
||||
velocityMadeGoodInKnotsTooltip=Die effektive Geschwindigkeit zum Ziel; auf der Kreuz die windwärtige Geschwindigkeit; auf der Vorwindstrecke die leewärtige Geschwindigkeit
|
||||
windwardDistanceToGoInMeters=Abstand in Windrichtung zur nächsten Bahnmarke
|
||||
windwardDistanceToGoInMetersTooltip=Windwärtige / leewärtige Distanz des Teilnehmerns bis zum Ende des Schenkels auf Kreuz bzw. Vorwindstrecke; Strecke entlang des Schenkels bei Holeschlägen
|
||||
windwardDistanceToLeaderInMeters=Abstand zum führenden Boot
|
||||
windwardDistanceToLeaderInMetersTooltip=Windwärtige Distanz des Teilnehmers zum Führenden
|
||||
windwardDistanceToCompetitorFarthestAheadInMeters=Windärtiger Abstand zum schnellsten Boot
|
||||
windwardDistanceToCompetitorFarthestAheadInMeters=Windwärtiger Abstand zum Boot, das bisher am weitesten windwärts gesegelt ist.\nFür Handicap-Wertungen ist das nicht notwendigerweise der nach Verrechnung in Führung liegende Teilnehmer.
|
||||
name=Name
|
||||
leaveEmptyForDefault=Leer für Standardeinstellung
|
||||
trackNewEvent=Track New event
|
||||
|
||||
+2
-2
@@ -91,8 +91,8 @@ velocityMadeGoodInKnots=Скорость лавирования (VMG)
|
||||
velocityMadeGoodInKnotsTooltip=Скорость лавирования, представляет собой скорость продвижения на ветер/ по ветру для этапов движения против ветра/ по ветру соответственно, или скорость в направлении движения при лавировании по ветру
|
||||
windwardDistanceToGoInMeters=Расстояние, которое необходимо пройти на ветер
|
||||
windwardDistanceToGoInMetersTooltip=Расстояние движения на ветер/ по ветру от текущего положения участника до конца этапа для этапов движения против ветра/ по ветру соответственно, или скорость в направлении движения при лавировании по ветру.
|
||||
windwardDistanceToLeaderInMeters=Расстояние на ветер до лидера
|
||||
windwardDistanceToLeaderInMetersTooltip=Расстояние на ветер/ под ветер от участника до лидера для этапов движения против ветра/ по ветру соответственно или скорость в направлении движения при лавировании по ветру.
|
||||
windwardDistanceToCompetitorFarthestAheadInMeters=Расстояние на ветер до лидера
|
||||
windwardDistanceToCompetitorFarthestAheadInMeters=Расстояние на ветер/ под ветер от участника до лидера для этапов движения против ветра/ по ветру соответственно или скорость в направлении движения при лавировании по ветру.
|
||||
name=Имя
|
||||
leaveEmptyForDefault=Оставьте пустым по умолчанию.
|
||||
trackNewEvent=Отследить новое событие
|
||||
|
||||
+1
-1
@@ -539,7 +539,7 @@ public abstract class AbstractCompetitorRaceChart<SettingsType extends ChartSett
|
||||
}
|
||||
|
||||
private boolean hasReversedYAxis(DetailType detailType) {
|
||||
return selectedDetailType == DetailType.WINDWARD_DISTANCE_TO_OVERALL_LEADER ||
|
||||
return selectedDetailType == DetailType.WINDWARD_DISTANCE_TO_COMPETITOR_FARTHEST_AHEAD ||
|
||||
selectedDetailType == DetailType.GAP_TO_LEADER_IN_SECONDS ||
|
||||
selectedDetailType == DetailType.RACE_RANK ||
|
||||
selectedDetailType == DetailType.REGATTA_RANK ||
|
||||
|
||||
+1
-1
@@ -38,7 +38,7 @@ public class MultiCompetitorRaceChart extends AbstractCompetitorRaceChart<MultiC
|
||||
final ErrorReporter errorReporter, boolean compactChart, boolean allowTimeAdjust,
|
||||
final String leaderboardGroupName, String leaderboardName) {
|
||||
super(sailingService, asyncActionsExecutor, competitorSelectionProvider, raceSelectionProvider, timer, timeRangeWithZoomProvider, stringMessages, errorReporter,
|
||||
/*show initially*/ DetailType.WINDWARD_DISTANCE_TO_OVERALL_LEADER, compactChart, allowTimeAdjust, leaderboardGroupName, leaderboardName);
|
||||
/*show initially*/ DetailType.WINDWARD_DISTANCE_TO_COMPETITOR_FARTHEST_AHEAD, compactChart, allowTimeAdjust, leaderboardGroupName, leaderboardName);
|
||||
if (leaderboardGroupName != null) {
|
||||
sailingService.getLeaderboardGroupByName(leaderboardGroupName, false,
|
||||
new AsyncCallback<LeaderboardGroupDTO>() {
|
||||
|
||||
+1
-1
@@ -25,7 +25,7 @@ public class MultiCompetitorRaceChartSettingsComponent extends AbstractChartSett
|
||||
this.initialDetailType = settings.getDetailType();
|
||||
|
||||
availableDetailsTypes = new ArrayList<DetailType>();
|
||||
availableDetailsTypes.add(DetailType.WINDWARD_DISTANCE_TO_OVERALL_LEADER);
|
||||
availableDetailsTypes.add(DetailType.WINDWARD_DISTANCE_TO_COMPETITOR_FARTHEST_AHEAD);
|
||||
availableDetailsTypes.add(DetailType.DISTANCE_TRAVELED);
|
||||
availableDetailsTypes.add(DetailType.DISTANCE_TRAVELED_INCLUDING_GATE_START);
|
||||
availableDetailsTypes.add(DetailType.VELOCITY_MADE_GOOD_IN_KNOTS);
|
||||
|
||||
+8
-7
@@ -863,7 +863,7 @@ public class LeaderboardPanel extends SimplePanel implements TimeListener, PlayS
|
||||
DetailType.RACE_DISTANCE_TRAVELED, DetailType.RACE_DISTANCE_TRAVELED_INCLUDING_GATE_START,
|
||||
DetailType.RACE_TIME_TRAVELED, DetailType.RACE_CORRECTED_TIME_TRAVELED,
|
||||
DetailType.RACE_CORRECTED_TIME_AT_ESTIMATED_ARRIVAL_AT_COMPETITOR_FARTHEST_AHEAD,
|
||||
DetailType.RACE_CURRENT_SPEED_OVER_GROUND_IN_KNOTS, DetailType.RACE_DISTANCE_TO_LEADER_IN_METERS,
|
||||
DetailType.RACE_CURRENT_SPEED_OVER_GROUND_IN_KNOTS, DetailType.RACE_DISTANCE_TO_COMPETITOR_FARTHEST_AHEAD_IN_METERS,
|
||||
DetailType.NUMBER_OF_MANEUVERS, DetailType.DISPLAY_LEGS, DetailType.CURRENT_LEG,
|
||||
DetailType.RACE_AVERAGE_ABSOLUTE_CROSS_TRACK_ERROR_IN_METERS,
|
||||
DetailType.RACE_AVERAGE_SIGNED_CROSS_TRACK_ERROR_IN_METERS,
|
||||
@@ -939,8 +939,8 @@ public class LeaderboardPanel extends SimplePanel implements TimeListener, PlayS
|
||||
result.put(DetailType.RACE_CURRENT_SPEED_OVER_GROUND_IN_KNOTS,
|
||||
new FormattedDoubleDetailTypeColumn(DetailType.RACE_CURRENT_SPEED_OVER_GROUND_IN_KNOTS, new CurrentSpeedOverGroundInKnots(),
|
||||
LEG_COLUMN_HEADER_STYLE, LEG_COLUMN_STYLE, LeaderboardPanel.this));
|
||||
result.put(DetailType.RACE_DISTANCE_TO_LEADER_IN_METERS,
|
||||
new FormattedDoubleDetailTypeColumn(DetailType.RACE_DISTANCE_TO_LEADER_IN_METERS, new RaceDistanceToLeaderInMeters(),
|
||||
result.put(DetailType.RACE_DISTANCE_TO_COMPETITOR_FARTHEST_AHEAD_IN_METERS,
|
||||
new FormattedDoubleDetailTypeColumn(DetailType.RACE_DISTANCE_TO_COMPETITOR_FARTHEST_AHEAD_IN_METERS, new RaceDistanceToCompetitorFarthestAheadInMeters(),
|
||||
LEG_COLUMN_HEADER_STYLE, LEG_COLUMN_STYLE, LeaderboardPanel.this));
|
||||
result.put(DetailType.RACE_AVERAGE_ABSOLUTE_CROSS_TRACK_ERROR_IN_METERS,
|
||||
new FormattedDoubleDetailTypeColumn(DetailType.RACE_AVERAGE_ABSOLUTE_CROSS_TRACK_ERROR_IN_METERS, new RaceAverageAbsoluteCrossTrackErrorInMeters(),
|
||||
@@ -1378,17 +1378,18 @@ public class LeaderboardPanel extends SimplePanel implements TimeListener, PlayS
|
||||
}
|
||||
|
||||
/**
|
||||
* Computes the windward distance to the overall leader in meters
|
||||
* Computes the windward distance to the competitor farthest ahead in the race (not necessarily the leader with
|
||||
* handicap scoring) in meters
|
||||
*
|
||||
* @author Axel Uhl (D043530)
|
||||
*/
|
||||
private class RaceDistanceToLeaderInMeters implements LegDetailField<Double> {
|
||||
private class RaceDistanceToCompetitorFarthestAheadInMeters implements LegDetailField<Double> {
|
||||
@Override
|
||||
public Double get(LeaderboardRowDTO row) {
|
||||
Double result = null;
|
||||
LeaderboardEntryDTO fieldsForRace = row.fieldsByRaceColumnName.get(getRaceColumnName());
|
||||
if (fieldsForRace != null && fieldsForRace.windwardDistanceToOverallLeaderInMeters != null) {
|
||||
result = fieldsForRace.windwardDistanceToOverallLeaderInMeters;
|
||||
if (fieldsForRace != null && fieldsForRace.windwardDistanceToCompetitorFarthestAheadInMeters != null) {
|
||||
result = fieldsForRace.windwardDistanceToCompetitorFarthestAheadInMeters;
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
+1
-1
@@ -67,7 +67,7 @@ public class LeaderboardSettingsFactory {
|
||||
List<DetailType> raceDetails = new ArrayList<DetailType>();
|
||||
raceDetails.add(DetailType.RACE_DISTANCE_TRAVELED);
|
||||
raceDetails.add(DetailType.RACE_AVERAGE_SPEED_OVER_GROUND_IN_KNOTS);
|
||||
raceDetails.add(DetailType.RACE_DISTANCE_TO_LEADER_IN_METERS);
|
||||
raceDetails.add(DetailType.RACE_DISTANCE_TO_COMPETITOR_FARTHEST_AHEAD_IN_METERS);
|
||||
raceDetails.add(DetailType.NUMBER_OF_MANEUVERS);
|
||||
raceDetails.add(DetailType.DISPLAY_LEGS);
|
||||
final List<DetailType> overallDetails = createOverallDetailsForShowRegattaRank(showRegattaRank);
|
||||
|
||||
+2
-2
@@ -2726,10 +2726,10 @@ public class SailingServiceImpl extends ProxiedRemoteServiceServlet implements S
|
||||
result = gapToLeaderInOwnTime == null ? null : gapToLeaderInOwnTime.asSeconds();
|
||||
}
|
||||
break;
|
||||
case WINDWARD_DISTANCE_TO_OVERALL_LEADER:
|
||||
case WINDWARD_DISTANCE_TO_COMPETITOR_FARTHEST_AHEAD:
|
||||
if (trackedLeg != null) {
|
||||
final RankingInfo rankingInfo = trackedRace.getRankingMetric().getRankingInfo(timePoint);
|
||||
Distance distanceToLeader = trackedLeg.getWindwardDistanceToOverallLeader(timePoint, WindPositionMode.LEG_MIDDLE, rankingInfo);
|
||||
Distance distanceToLeader = trackedLeg.getWindwardDistanceToCompetitorFarthestAhead(timePoint, WindPositionMode.LEG_MIDDLE, rankingInfo);
|
||||
result = (distanceToLeader == null) ? null : distanceToLeader.getMeters();
|
||||
}
|
||||
break;
|
||||
|
||||
+4
-4
@@ -996,11 +996,11 @@ public class RegattasResource extends AbstractSailingServerResource {
|
||||
jsonCompetitorInLeg.put("gapToLeader-s", roundDouble(gapToLeader.asSeconds(), 2));
|
||||
}
|
||||
|
||||
Distance windwardDistanceToOverallLeader = currentLegOfCompetitor
|
||||
.getWindwardDistanceToOverallLeader(timePoint, WindPositionMode.LEG_MIDDLE, rankingInfo);
|
||||
if (windwardDistanceToOverallLeader != null) {
|
||||
Distance windwardDistanceToCompetitorFarthestAhead = currentLegOfCompetitor
|
||||
.getWindwardDistanceToCompetitorFarthestAhead(timePoint, WindPositionMode.LEG_MIDDLE, rankingInfo);
|
||||
if (windwardDistanceToCompetitorFarthestAhead != null) {
|
||||
jsonCompetitorInLeg.put("gapToLeader-m",
|
||||
roundDouble(windwardDistanceToOverallLeader.getMeters(), 2));
|
||||
roundDouble(windwardDistanceToCompetitorFarthestAhead.getMeters(), 2));
|
||||
}
|
||||
jsonCompetitorInLeg.put("finished", false);
|
||||
} else {
|
||||
|
||||
@@ -17,7 +17,7 @@
|
||||
<listEntry value="org.eclipse.debug.ui.launchGroup.run"/>
|
||||
</listAttribute>
|
||||
<booleanAttribute key="org.eclipse.jdt.launching.ATTR_USE_START_ON_FIRST_THREAD" value="true"/>
|
||||
<stringAttribute key="org.eclipse.jdt.launching.JRE_CONTAINER" value="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/sapjvm_8"/>
|
||||
<stringAttribute key="org.eclipse.jdt.launching.JRE_CONTAINER" value="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.8"/>
|
||||
<stringAttribute key="org.eclipse.jdt.launching.PROGRAM_ARGUMENTS" value="-os ${target.os} -ws ${target.ws} -arch ${target.arch} -nl ${target.nl} -consoleLog -console -clean"/>
|
||||
<stringAttribute key="org.eclipse.jdt.launching.SOURCE_PATH_PROVIDER" value="org.eclipse.pde.ui.workbenchClasspathProvider"/>
|
||||
<stringAttribute key="org.eclipse.jdt.launching.VM_ARGUMENTS" value="-ea -Declipse.ignoreApp=true -Dosgi.noShutdown=true -Dfile.encoding=cp1252 -Dexpedition.udp.port=2010 -Xmx6000m -XX:+UseG1GC -Djetty.home=${project_loc:com.sap.sailing.server}/../target/configuration/jetty -Djava.util.logging.config.file=${project_loc:com.sap.sailing.server}/../target/configuration/logging_debug.properties -Dkiwo.results=${project_loc:com.sap.sailing.kiworesultimport.test}/resources -Dpersistentcompetitors.clear=false -XX:+UseMembar -Digtimi.client.id=7fcdd217e0aa16090edb4ad55b09ec43b2021090e209541fc9b7003c2a2b70c6 -Digtimi.client.secret=aa569cf4909bdc7b0e04b11873f3c4ea20687421e010fcc25b771cca9e6f3f9a -Digtimi.client.redirecturi=http://127.0.0.1:8888/igtimi/oauth/v1/authorizationcallback"/>
|
||||
|
||||
+2
-2
@@ -340,7 +340,7 @@ public class DummyTrackedRace extends TrackedRaceWithWindEssentials {
|
||||
}
|
||||
|
||||
@Override
|
||||
public Distance getWindwardDistanceToOverallLeader(Competitor competitor, TimePoint timePoint, WindPositionMode windPositionMode) {
|
||||
public Distance getWindwardDistanceToCompetitorFarthestAhead(Competitor competitor, TimePoint timePoint, WindPositionMode windPositionMode) {
|
||||
return null;
|
||||
}
|
||||
|
||||
@@ -597,7 +597,7 @@ public class DummyTrackedRace extends TrackedRaceWithWindEssentials {
|
||||
}
|
||||
|
||||
@Override
|
||||
public Distance getWindwardDistanceToOverallLeader(Competitor competitor, TimePoint timePoint,
|
||||
public Distance getWindwardDistanceToCompetitorFarthestAhead(Competitor competitor, TimePoint timePoint,
|
||||
WindPositionMode windPositionMode, RankingInfo rankingInfo, WindLegTypeAndLegBearingCache cache) {
|
||||
return null;
|
||||
}
|
||||
|
||||
@@ -655,8 +655,9 @@ public class LeaderboardData extends ExportAction {
|
||||
}
|
||||
addNamedElementWithValue(competitorLegDataElement, "time_spend_in_this_leg_as_millis", timeSpentInThisLeg != null ? timeSpentInThisLeg.asMillis() : new MillisecondsDurationImpl(0).asMillis());
|
||||
addNamedElementWithValue(competitorLegDataElement, "gap_to_leader_at_finish_in_seconds", competitorLeg.getGapToLeader(legFinishTime, rankingMetricAtLegFinishTime, WindPositionMode.LEG_MIDDLE).asSeconds());
|
||||
Distance windwardDistanceToOverallLeader = competitorLeg.getWindwardDistanceToOverallLeader(legFinishTime, WindPositionMode.LEG_MIDDLE, rankingMetricAtLegFinishTime);
|
||||
addNamedElementWithValue(competitorLegDataElement, "windward_distance_to_overall_leader_that_has_finished_this_leg_in_meters", windwardDistanceToOverallLeader != null ? windwardDistanceToOverallLeader.getMeters() : 0);
|
||||
Distance windwardDistanceToCompetitorFarthestAhead = competitorLeg.getWindwardDistanceToCompetitorFarthestAhead(legFinishTime, WindPositionMode.LEG_MIDDLE, rankingMetricAtLegFinishTime);
|
||||
// TODO bug1018 decide whether the following field should be renamed to express that it's not the distance to the "leader" but the competitor farthest ahead; discussed with Simon on 2015-05-28; Simon says we leave it like this for now
|
||||
addNamedElementWithValue(competitorLegDataElement, "windward_distance_to_overall_leader_that_has_finished_this_leg_in_meters", windwardDistanceToCompetitorFarthestAhead != null ? windwardDistanceToCompetitorFarthestAhead.getMeters() : 0);
|
||||
addNamedElementWithValue(competitorLegDataElement, "distance_traveled_in_meters", competitorLeg.getDistanceTraveled(legFinishTime).getMeters());
|
||||
addNamedElementWithValue(competitorLegDataElement, "average_speed_over_ground_in_knots", competitorLeg.getAverageSpeedOverGround(legFinishTime).getKnots());
|
||||
|
||||
|
||||
Reference in new issue
Block a user