mirror of
https://github.com/eclipse-sailing-analytics/sailing-analytics.git
synced 2026-09-21 21:25:38 +00:00
bug6069 aftermath: factoring the commonalities of Has...OfCompetitor
This commit is contained in:
+39
-44
@@ -1,7 +1,6 @@
|
||||
package com.sap.sailing.datamining.data;
|
||||
|
||||
import com.sap.sailing.domain.base.Boat;
|
||||
import com.sap.sailing.domain.base.Competitor;
|
||||
import com.sap.sailing.domain.tracking.TrackedLegOfCompetitor;
|
||||
import com.sap.sse.common.Distance;
|
||||
import com.sap.sse.common.Duration;
|
||||
@@ -19,91 +18,87 @@ import com.sap.sse.datamining.shared.impl.dto.ClusterDTO;
|
||||
* @author Axel Uhl (d043530)
|
||||
*
|
||||
*/
|
||||
public interface AbstractHasTrackedLegSliceOfCompetitorContext extends HasWindOnTrackedLeg {
|
||||
public interface AbstractHasTrackedLegSliceOfCompetitorContext extends HasWindOnTrackedLeg, HasSomethingOfCompetitorContext {
|
||||
@Connector(scanForStatistics=false)
|
||||
public HasTrackedLegContext getTrackedLegContext();
|
||||
HasTrackedLegContext getTrackedLegContext();
|
||||
|
||||
public TrackedLegOfCompetitor getTrackedLegOfCompetitor();
|
||||
TrackedLegOfCompetitor getTrackedLegOfCompetitor();
|
||||
|
||||
@Dimension(messageKey="RelativeScoreInRaceInPercent", ordinal=12)
|
||||
public ClusterDTO getPercentageClusterForRelativeScoreInRace();
|
||||
|
||||
@Connector(messageKey="Boat")
|
||||
public Boat getBoat();
|
||||
|
||||
@Connector(messageKey="Competitor")
|
||||
public Competitor getCompetitor();
|
||||
|
||||
@Connector(messageKey="SailorProfile")
|
||||
default public SailorProfile getSailorProfile() {
|
||||
return getTrackedLegContext().getTrackedRaceContext().getLeaderboardContext().getLeaderboardGroupContext().getSailorProfiles().getProfileForCompetitor(getCompetitor());
|
||||
default HasTrackedRaceContext getTrackedRaceContext() {
|
||||
return getTrackedLegContext().getTrackedRaceContext();
|
||||
}
|
||||
|
||||
@Dimension(messageKey="RelativeScoreInRaceInPercent", ordinal=12)
|
||||
ClusterDTO getPercentageClusterForRelativeScoreInRace();
|
||||
|
||||
@Connector(messageKey="Boat")
|
||||
Boat getBoat();
|
||||
|
||||
@Statistic(messageKey="DistanceTraveled", resultDecimals=2, ordinal=0)
|
||||
public Distance getDistanceTraveled();
|
||||
Distance getDistanceTraveled();
|
||||
|
||||
@Statistic(messageKey="SpeedAverage", resultDecimals=2, ordinal=0)
|
||||
public Double getSpeedAverageInKnots();
|
||||
Double getSpeedAverageInKnots();
|
||||
|
||||
@Statistic(messageKey="RankGainsOrLosses", resultDecimals=2, ordinal=1)
|
||||
public Integer getRankGainsOrLosses();
|
||||
Integer getRankGainsOrLosses();
|
||||
|
||||
@Statistic(messageKey="RelativeScore", resultDecimals=2, ordinal=2)
|
||||
public Double getRelativeRank();
|
||||
Double getRelativeRank();
|
||||
|
||||
@Statistic(messageKey="AbsoluteRank", resultDecimals=0, ordinal=3)
|
||||
public Integer getRankAtSliceFinish();
|
||||
Integer getRankAtSliceFinish();
|
||||
|
||||
@Statistic(messageKey="AbsoluteRankAfterFirstQuarter", resultDecimals=0, ordinal=4)
|
||||
public Integer getRankAfterFirstQuarter();
|
||||
Integer getRankAfterFirstQuarter();
|
||||
|
||||
@Statistic(messageKey="AbsoluteRankAfterSecondQuarter", resultDecimals=0, ordinal=5)
|
||||
public Integer getRankAfterSecondQuarter();
|
||||
Integer getRankAfterSecondQuarter();
|
||||
|
||||
@Statistic(messageKey="AbsoluteRankAfterThirdQuarter", resultDecimals=0, ordinal=6)
|
||||
public Integer getRankAfterThirdQuarter();
|
||||
Integer getRankAfterThirdQuarter();
|
||||
|
||||
@Statistic(messageKey="AbsoluteRankAverageAcrossFirstThreeQuarters", resultDecimals=2, ordinal=7)
|
||||
public Double getRankAverageAcrossFirstThreeQuarters();
|
||||
Double getRankAverageAcrossFirstThreeQuarters();
|
||||
|
||||
@Statistic(messageKey="AbsoluteRankRhumbLineBasedAfterFirstQuarter", resultDecimals=0, ordinal=8)
|
||||
public Integer getRankRhumbLineBasedAfterFirstQuarter();
|
||||
Integer getRankRhumbLineBasedAfterFirstQuarter();
|
||||
|
||||
@Statistic(messageKey="AbsoluteRankRhumbLineBasedAfterSecondQuarter", resultDecimals=0, ordinal=9)
|
||||
public Integer getRankRhumbLineBasedAfterSecondQuarter();
|
||||
Integer getRankRhumbLineBasedAfterSecondQuarter();
|
||||
|
||||
@Statistic(messageKey="AbsoluteRankRhumbLineBasedAfterThirdQuarter", resultDecimals=0, ordinal=10)
|
||||
public Integer getRankRhumbLineBasedAfterThirdQuarter();
|
||||
Integer getRankRhumbLineBasedAfterThirdQuarter();
|
||||
|
||||
@Statistic(messageKey="AbsoluteRankRhumbLineBasedAverageAcrossFirstThreeQuarters", resultDecimals=2, ordinal=11)
|
||||
public Double getRankRhumbLineBasedAverageAcrossFirstThreeQuarters();
|
||||
Double getRankRhumbLineBasedAverageAcrossFirstThreeQuarters();
|
||||
|
||||
@Statistic(messageKey="AbsoluteRankPredictionErrorAfterFirstQuarter", resultDecimals=2, ordinal=12)
|
||||
public Double getRankPredictionErrorAfterFirstQuarter();
|
||||
Double getRankPredictionErrorAfterFirstQuarter();
|
||||
|
||||
@Statistic(messageKey="AbsoluteRankPredictionErrorAfterSecondQuarter", resultDecimals=2, ordinal=13)
|
||||
public Double getRankPredictionErrorAfterSecondQuarter();
|
||||
Double getRankPredictionErrorAfterSecondQuarter();
|
||||
|
||||
@Statistic(messageKey="AbsoluteRankPredictionErrorAfterThirdQuarter", resultDecimals=2, ordinal=14)
|
||||
public Double getRankPredictionErrorAfterThirdQuarter();
|
||||
Double getRankPredictionErrorAfterThirdQuarter();
|
||||
|
||||
@Statistic(messageKey="AbsoluteRankPredictionErrorAcrossFirstThreeQuarters", resultDecimals=2, ordinal=15)
|
||||
public Double getRankPredictionErrorAcrossFirstThreeQuarters();
|
||||
Double getRankPredictionErrorAcrossFirstThreeQuarters();
|
||||
|
||||
@Statistic(messageKey="AbsoluteRankPredictionErrorRhumbLineBasedAfterFirstQuarter", resultDecimals=2, ordinal=16)
|
||||
public Double getRankPredictionErrorRhumbLineBasedAfterFirstQuarter();
|
||||
Double getRankPredictionErrorRhumbLineBasedAfterFirstQuarter();
|
||||
|
||||
@Statistic(messageKey="AbsoluteRankPredictionErrorRhumbLineBasedAfterSecondQuarter", resultDecimals=2, ordinal=17)
|
||||
public Double getRankPredictionErrorRhumbLineBasedAfterSecondQuarter();
|
||||
Double getRankPredictionErrorRhumbLineBasedAfterSecondQuarter();
|
||||
|
||||
@Statistic(messageKey="AbsoluteRankPredictionErrorRhumbLineBasedAfterThirdQuarter", resultDecimals=2, ordinal=18)
|
||||
public Double getRankPredictionErrorRhumbLineBasedAfterThirdQuarter();
|
||||
Double getRankPredictionErrorRhumbLineBasedAfterThirdQuarter();
|
||||
|
||||
@Statistic(messageKey="AbsoluteRankPredictionErrorRhumbLineBasedAcrossFirstThreeQuarters", resultDecimals=2, ordinal=19)
|
||||
public Double getRankPredictionErrorRhumbLineBasedAcrossFirstThreeQuarters();
|
||||
Double getRankPredictionErrorRhumbLineBasedAcrossFirstThreeQuarters();
|
||||
|
||||
@Statistic(messageKey="TimeSpentInSeconds", resultDecimals=0, ordinal=4)
|
||||
public Long getTimeTakenInSeconds();
|
||||
Long getTimeTakenInSeconds();
|
||||
|
||||
@Statistic(messageKey="timeSpentFoiling", resultDecimals=1)
|
||||
Duration getTimeSpentFoiling();
|
||||
@@ -112,20 +107,20 @@ public interface AbstractHasTrackedLegSliceOfCompetitorContext extends HasWindOn
|
||||
Distance getDistanceSpentFoiling();
|
||||
|
||||
@Statistic(messageKey="NumberOfManeuvers", resultDecimals=0)
|
||||
public Integer getNumberOfManeuvers();
|
||||
Integer getNumberOfManeuvers();
|
||||
|
||||
@Statistic(messageKey="NumberOfJibes", resultDecimals=0)
|
||||
public Integer getNumberOfJibes();
|
||||
Integer getNumberOfJibes();
|
||||
|
||||
@Statistic(messageKey="NumberOfTacks", resultDecimals=0)
|
||||
public Integer getNumberOfTacks();
|
||||
Integer getNumberOfTacks();
|
||||
|
||||
@Statistic(messageKey="VMG", resultDecimals=2)
|
||||
public Speed getVelocityMadeGood();
|
||||
Speed getVelocityMadeGood();
|
||||
|
||||
@Statistic(messageKey="RatioDurationLongVsShortTack", resultDecimals=2)
|
||||
public double getRatioDurationLongVsShortTack();
|
||||
double getRatioDurationLongVsShortTack();
|
||||
|
||||
@Statistic(messageKey="RatioDistanceLongVsShortTack", resultDecimals=2)
|
||||
public double getRatioDistanceLongVsShortTack();
|
||||
double getRatioDistanceLongVsShortTack();
|
||||
}
|
||||
+2
-12
@@ -1,7 +1,6 @@
|
||||
package com.sap.sailing.datamining.data;
|
||||
|
||||
import com.sap.sailing.domain.base.Boat;
|
||||
import com.sap.sailing.domain.base.Competitor;
|
||||
import com.sap.sailing.domain.common.MaxPointsReason;
|
||||
import com.sap.sailing.domain.common.NoWindException;
|
||||
import com.sap.sailing.domain.common.Tack;
|
||||
@@ -14,20 +13,11 @@ import com.sap.sse.datamining.annotations.Dimension;
|
||||
import com.sap.sse.datamining.annotations.Statistic;
|
||||
import com.sap.sse.datamining.shared.impl.dto.ClusterDTO;
|
||||
|
||||
public interface HasRaceOfCompetitorContext {
|
||||
|
||||
public interface HasRaceOfCompetitorContext extends HasSomethingOfCompetitorContext {
|
||||
@Override
|
||||
@Connector(scanForStatistics=false)
|
||||
HasTrackedRaceContext getTrackedRaceContext();
|
||||
|
||||
@Connector(messageKey="Competitor")
|
||||
@Statistic(messageKey="Competitor")
|
||||
Competitor getCompetitor();
|
||||
|
||||
@Connector(messageKey="SailorProfile")
|
||||
default public SailorProfile getSailorProfile() {
|
||||
return getTrackedRaceContext().getLeaderboardContext().getLeaderboardGroupContext().getSailorProfiles().getProfileForCompetitor(getCompetitor());
|
||||
}
|
||||
|
||||
@Dimension(messageKey="TackAtStart", ordinal=12)
|
||||
Tack getTackAtStart() throws NoWindException;
|
||||
|
||||
|
||||
+11
-20
@@ -1,37 +1,28 @@
|
||||
package com.sap.sailing.datamining.data;
|
||||
|
||||
import com.sap.sailing.domain.base.Boat;
|
||||
import com.sap.sailing.domain.base.Competitor;
|
||||
import com.sap.sailing.domain.common.MaxPointsReason;
|
||||
import com.sap.sse.datamining.annotations.Connector;
|
||||
import com.sap.sse.datamining.annotations.Dimension;
|
||||
import com.sap.sse.datamining.annotations.Statistic;
|
||||
import com.sap.sse.datamining.shared.impl.dto.ClusterDTO;
|
||||
|
||||
public interface HasRaceResultOfCompetitorContext {
|
||||
|
||||
public interface HasRaceResultOfCompetitorContext extends HasSomethingOfCompetitorContext {
|
||||
@Connector(scanForStatistics=false)
|
||||
public HasLeaderboardContext getLeaderboardContext();
|
||||
HasLeaderboardContext getLeaderboardContext();
|
||||
|
||||
@Override
|
||||
@Connector(scanForStatistics=false)
|
||||
public HasTrackedRaceContext getTrackedRaceContext();
|
||||
HasTrackedRaceContext getTrackedRaceContext();
|
||||
|
||||
@Connector(messageKey="Competitor", ordinal=2)
|
||||
public Competitor getCompetitor();
|
||||
|
||||
@Connector(messageKey="SailorProfile")
|
||||
default public SailorProfile getSailorProfile() {
|
||||
return getTrackedRaceContext().getLeaderboardContext().getLeaderboardGroupContext().getSailorProfiles().getProfileForCompetitor(getCompetitor());
|
||||
}
|
||||
|
||||
@Connector(messageKey="Boat")
|
||||
public Boat getBoat();
|
||||
Boat getBoat();
|
||||
|
||||
@Dimension(messageKey="Regatta", ordinal=4)
|
||||
String getRegattaName();
|
||||
|
||||
@Dimension(messageKey="RelativeScoreInPercent", ordinal=6)
|
||||
public ClusterDTO getPercentageClusterForRelativeScore();
|
||||
ClusterDTO getPercentageClusterForRelativeScore();
|
||||
|
||||
@Dimension(messageKey="WindSpeedInBeaufort", ordinal=7)
|
||||
int getAverageWindSpeedInRoundedBeaufort();
|
||||
@@ -40,20 +31,20 @@ public interface HasRaceResultOfCompetitorContext {
|
||||
* 0 means the competitor won the race, 1 means the competitor ranked last
|
||||
*/
|
||||
@Statistic(messageKey="RelativeScore", ordinal=1, resultDecimals=2)
|
||||
public Double getRelativeRank();
|
||||
Double getRelativeRank();
|
||||
|
||||
@Statistic(messageKey="AbsoluteRank", ordinal=2, resultDecimals=2)
|
||||
public Double getAbsoluteRank();
|
||||
Double getAbsoluteRank();
|
||||
|
||||
@Dimension(messageKey="IRM")
|
||||
public MaxPointsReason getMaxPointsReason();
|
||||
MaxPointsReason getMaxPointsReason();
|
||||
|
||||
@Dimension(messageKey="Discarded")
|
||||
boolean isDiscarded();
|
||||
|
||||
@Statistic(messageKey="NumberOfPodiumFinish", ordinal=3)
|
||||
public Boolean isPodiumFinish();
|
||||
Boolean isPodiumFinish();
|
||||
|
||||
@Statistic(messageKey="NumberOfWins", ordinal=4)
|
||||
public Boolean isWin();
|
||||
Boolean isWin();
|
||||
}
|
||||
|
||||
+16
@@ -0,0 +1,16 @@
|
||||
package com.sap.sailing.datamining.data;
|
||||
|
||||
import com.sap.sailing.domain.base.Competitor;
|
||||
import com.sap.sse.datamining.annotations.Connector;
|
||||
|
||||
public interface HasSomethingOfCompetitorContext {
|
||||
HasTrackedRaceContext getTrackedRaceContext();
|
||||
|
||||
@Connector(messageKey="Competitor", ordinal=2)
|
||||
Competitor getCompetitor();
|
||||
|
||||
@Connector(messageKey="SailorProfile")
|
||||
default SailorProfile getSailorProfile() {
|
||||
return getTrackedRaceContext().getLeaderboardContext().getLeaderboardGroupContext().getSailorProfiles().getProfileForCompetitor(getCompetitor());
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user