From c4c0b8ea74f44480b40a16ef50eb206be3cf4045 Mon Sep 17 00:00:00 2001 From: Vladislav Chumak Date: Fri, 23 Mar 2018 18:08:21 +0100 Subject: [PATCH] Javadoc and naming --- .../IncrementalManeuverDetector.java | 13 ++- .../maneuverdetection/ManeuverDetector.java | 62 ++++++++----- .../impl/IncrementalManeuverDetectorImpl.java | 6 +- .../impl/ManeuverDetectorImpl.java | 87 ++++++++----------- .../maneuverdetection/impl/ManeuverSpot.java | 8 +- ...rCurve.java => CompleteManeuverCurve.java} | 16 +++- .../sap/sailing/domain/tracking/Maneuver.java | 2 +- .../tracking/impl/ManeuverCurveImpl.java | 4 +- 8 files changed, 108 insertions(+), 90 deletions(-) rename java/com.sap.sailing.domain/src/com/sap/sailing/domain/tracking/{ManeuverCurve.java => CompleteManeuverCurve.java} (62%) diff --git a/java/com.sap.sailing.domain/src/com/sap/sailing/domain/maneuverdetection/IncrementalManeuverDetector.java b/java/com.sap.sailing.domain/src/com/sap/sailing/domain/maneuverdetection/IncrementalManeuverDetector.java index fc9a1c740d8..4e51d99d00d 100644 --- a/java/com.sap.sailing.domain/src/com/sap/sailing/domain/maneuverdetection/IncrementalManeuverDetector.java +++ b/java/com.sap.sailing.domain/src/com/sap/sailing/domain/maneuverdetection/IncrementalManeuverDetector.java @@ -3,7 +3,7 @@ package com.sap.sailing.domain.maneuverdetection; import java.util.List; import com.sap.sailing.domain.tracking.Maneuver; -import com.sap.sailing.domain.tracking.ManeuverCurve; +import com.sap.sailing.domain.tracking.CompleteManeuverCurve; /** * An extension of {@link ManeuverDetector} which supports incremental maneuver detection within calls of @@ -17,11 +17,16 @@ import com.sap.sailing.domain.tracking.ManeuverCurve; public interface IncrementalManeuverDetector extends ManeuverDetector { /** - * Gets the detected maneuvers during previous calls of {@link #detectManeuvers()} + * Gets the already detected maneuvers by previous calls of {@link #detectManeuvers()} and + * {@link #detectManeuverCurves()}. */ List getAlreadyDetectedManeuvers(); - - List getAlreadyDetectedManeuverCurves(); + + /** + * Gets the already detected maneuver curves by previous calls of {@link #detectManeuvers()} and + * {@link #detectManeuverCurves()}. + */ + List getAlreadyDetectedManeuverCurves(); /** * Clears the whole state of the detector, which is used for incremental maneuver detection. The following calls of diff --git a/java/com.sap.sailing.domain/src/com/sap/sailing/domain/maneuverdetection/ManeuverDetector.java b/java/com.sap.sailing.domain/src/com/sap/sailing/domain/maneuverdetection/ManeuverDetector.java index a451f47b32a..dae70420b96 100644 --- a/java/com.sap.sailing.domain/src/com/sap/sailing/domain/maneuverdetection/ManeuverDetector.java +++ b/java/com.sap.sailing.domain/src/com/sap/sailing/domain/maneuverdetection/ManeuverDetector.java @@ -2,12 +2,25 @@ package com.sap.sailing.domain.maneuverdetection; import java.util.List; -import com.sap.sailing.domain.base.BoatClass; +import com.sap.sailing.domain.tracking.CompleteManeuverCurve; import com.sap.sailing.domain.tracking.Maneuver; -import com.sap.sailing.domain.tracking.ManeuverCurve; /** - * Determines maneuvers performed within a tracked race. + * Determines maneuvers performed within a tracked race by competitor associated with this + * {@link ManeuverDetector}-instance. The steps of maneuver detection look as follows: + *
    + *
  1. Douglas-Peucker-fixes set is determined for the GPS-track of competitor. The analyzed GPS-fixes set gets limited + * by the set contained between the time points of crossing start line and finish-line. The limit does not apply if no + * start-line has been crossed by the competitor at all. In case of absent crossing of finish-line, the GPS-fix set gets + * analyzed until the last available GPS-fix.
  2. + *
  3. The bearings between DP-fixes are calculated
  4. + *
  5. Consecutive DP-fixes get grouped together if their sign of associated bearing is equal and the duration and + * distance limits between DP-fixes is satisfied.
  6. + *
  7. For each DP-fixes group a {@link CompleteManeuverCurve} gets determined
  8. + *
  9. For each {@link CompleteManeuverCurve}-instance appropriate {@link Maneuver}-instance(s) are determined. In + * contrast to maneuvers, the complete maneuver curves are not subject to any splitting logic for maneuvers with + * multiple "tacking" and "jibing".
  10. + *
      * * @author Vladislav Chumak (D069712) * @@ -15,27 +28,36 @@ import com.sap.sailing.domain.tracking.ManeuverCurve; public interface ManeuverDetector { /** - * Tries to detect maneuvers on the competitor's track based on a number of approximating fixes. The - * fixes contain bearing information, but this is not the bearing leading to the next approximation fix but the - * bearing the boat had at the time of the approximating fix which is taken from the original track. - *

      + * Detects maneuvers performed within a GPS-track of the competitor associated with this + * {@link ManeuverDetector}-instance. See {@link ManeuverDetector} description for more info regarding the detection + * strategy. * - * The time period assumed for a maneuver duration is taken from the - * {@link BoatClass#getApproximateManeuverDurationInMilliseconds() boat class}. If no maneuver is detected, an empty - * list is returned. Maneuvers can only be expected to be detected if at least three fixes are provided in - * approximatedFixesToAnalyze. For the inner approximating fixes (all except the first and the last - * approximating fix), their course changes according to the approximated path (and not the underlying actual - * tracked fixes) are computed. Subsequent course changes to the same direction are then grouped. Those in closer - * timely distance than {@link #getApproximateManeuverDurationInMilliseconds()} (including single course changes - * that have no surrounding other course changes to group) are grouped into one {@link Maneuver}. - * - * @return an empty list if no maneuver is detected for competitor between from and - * to, or else the list of maneuvers detected. + * @return an empty list if no maneuvers were detected, otherwise the list with detected maneuvers. */ List detectManeuvers(); - List detectManeuvers(Iterable maneuverCurves); + /** + * Derives maneuvers from the provided {@code maneuverCurves}. Since the provided complete maneuver curves already + * include the calculated boundaries of each complete maneuvering spot, this method operates in a very + * performance-efficient manner. + * + * @param maneuverCurves + * The maneuver curves from which the maneuvers shall be derived + * @return The maneuvers derived from the provided maneuver curves. The list gets empty, if the provided maneuver + * curves list is also empty. + */ + List detectManeuvers(Iterable maneuverCurves); - List detectManeuverCurves(); + /** + * Detects the complete maneuver curves performed within a GPS-track of the competitor associated with this + * {@link ManeuverDetector}-instance. In contrast to maneuvers determined by {@link #detectManeuvers()}, the + * complete maneuver curves are not subject to any splitting logic for maneuvers with multiple "tacking" and + * "jibing". See {@link ManeuverDetector} description for more info regarding the detection strategy. + * + * @return an empty list if no maneuver spots were detected, otherwise the list with detected maneuver curves. + * @see CompleteManeuverCurve + * @see ManeuverDetector + */ + List detectManeuverCurves(); } diff --git a/java/com.sap.sailing.domain/src/com/sap/sailing/domain/maneuverdetection/impl/IncrementalManeuverDetectorImpl.java b/java/com.sap.sailing.domain/src/com/sap/sailing/domain/maneuverdetection/impl/IncrementalManeuverDetectorImpl.java index 05aea16d70e..8b75854a5a3 100644 --- a/java/com.sap.sailing.domain/src/com/sap/sailing/domain/maneuverdetection/impl/IncrementalManeuverDetectorImpl.java +++ b/java/com.sap.sailing.domain/src/com/sap/sailing/domain/maneuverdetection/impl/IncrementalManeuverDetectorImpl.java @@ -15,7 +15,7 @@ import com.sap.sailing.domain.common.tracking.GPSFixMoving; import com.sap.sailing.domain.maneuverdetection.ApproximatedFixesCalculator; import com.sap.sailing.domain.maneuverdetection.IncrementalManeuverDetector; import com.sap.sailing.domain.tracking.Maneuver; -import com.sap.sailing.domain.tracking.ManeuverCurve; +import com.sap.sailing.domain.tracking.CompleteManeuverCurve; import com.sap.sailing.domain.tracking.TrackedRace; import com.sap.sse.common.Duration; import com.sap.sse.common.TimePoint; @@ -105,7 +105,7 @@ public class IncrementalManeuverDetectorImpl extends ManeuverDetectorImpl implem } @Override - public List getAlreadyDetectedManeuverCurves() { + public List getAlreadyDetectedManeuverCurves() { ManeuverDetectionResult lastManeuverDetectionResult = this.lastManeuverDetectionResult; if (lastManeuverDetectionResult != null) { return lastManeuverDetectionResult.getManeuverSpots().stream().filter(maneuverSpot -> maneuverSpot.getManeuverCurve() != null) @@ -200,7 +200,7 @@ public class IncrementalManeuverDetectorImpl extends ManeuverDetectorImpl implem } else { // New wind information has been received which considerably differs from previous // maneuver spot calculation => recalculate maneuvers of existing maneuver curve - ManeuverCurve maneuverCurve = matchingManeuverSpotFromState.getManeuverCurve(); + CompleteManeuverCurve maneuverCurve = matchingManeuverSpotFromState.getManeuverCurve(); ManeuverSpot maneuverSpot; if (maneuverCurve != null) { WindMeasurement windMeasurement = matchingManeuverSpotFromState diff --git a/java/com.sap.sailing.domain/src/com/sap/sailing/domain/maneuverdetection/impl/ManeuverDetectorImpl.java b/java/com.sap.sailing.domain/src/com/sap/sailing/domain/maneuverdetection/impl/ManeuverDetectorImpl.java index f1507067206..4db9e240265 100644 --- a/java/com.sap.sailing.domain/src/com/sap/sailing/domain/maneuverdetection/impl/ManeuverDetectorImpl.java +++ b/java/com.sap.sailing.domain/src/com/sap/sailing/domain/maneuverdetection/impl/ManeuverDetectorImpl.java @@ -29,7 +29,7 @@ import com.sap.sailing.domain.common.tracking.GPSFixMoving; import com.sap.sailing.domain.maneuverdetection.ManeuverDetector; import com.sap.sailing.domain.tracking.GPSFixTrack; import com.sap.sailing.domain.tracking.Maneuver; -import com.sap.sailing.domain.tracking.ManeuverCurve; +import com.sap.sailing.domain.tracking.CompleteManeuverCurve; import com.sap.sailing.domain.tracking.ManeuverCurveBoundaries; import com.sap.sailing.domain.tracking.MarkPassing; import com.sap.sailing.domain.tracking.SpeedWithBearingStep; @@ -119,9 +119,9 @@ public class ManeuverDetectorImpl implements ManeuverDetector { } @Override - public List detectManeuvers(Iterable maneuverCurves) { + public List detectManeuvers(Iterable maneuverCurves) { List maneuvers = new ArrayList<>(); - for (ManeuverCurve maneuverCurve : maneuverCurves) { + for (CompleteManeuverCurve maneuverCurve : maneuverCurves) { TimePoint maneuverTimePoint = maneuverCurve.getManeuverCurveWithStableSpeedAndCourseBoundaries() .getTimePoint(); Position maneuverPosition = track.getEstimatedPosition(maneuverTimePoint, /* extrapolate */false); @@ -134,7 +134,7 @@ public class ManeuverDetectorImpl implements ManeuverDetector { } @Override - public List detectManeuverCurves() { + public List detectManeuverCurves() { List maneuverSpots = detectManeuverSpots(); return maneuverSpots.stream().filter(maneuverSpot -> maneuverSpot.getManeuverCurve() != null) .map(maneuverSpot -> maneuverSpot.getManeuverCurve()).collect(Collectors.toList()); @@ -209,19 +209,8 @@ public class ManeuverDetectorImpl implements ManeuverDetector { } /** - * Tries to detect maneuvers on the competitor's track based on a number of approximating fixes. The - * fixes contain bearing information, but this is not the bearing leading to the next approximation fix but the - * bearing the boat had at the time of the approximating fix which is taken from the original track. - *

      - * - * The time period assumed for a maneuver duration is taken from the - * {@link BoatClass#getApproximateManeuverDurationInMilliseconds() boat class}. If no maneuver is detected, an empty - * list is returned. Maneuvers can only be expected to be detected if at least three fixes are provided in - * approximatedFixesToAnalyze. For the inner approximating fixes (all except the first and the last - * approximating fix), their course changes according to the approximated path (and not the underlying actual - * tracked fixes) are computed. Subsequent course changes to the same direction are then grouped. Those in closer - * timely distance than {@link #getApproximateManeuverDurationInMilliseconds()} (including single course changes - * that have no surrounding other course changes to group) are grouped into one {@link Maneuver}. + * Detects the maneuver spots with corresponding maneuvers within provided time frame. See step 1ff. in + * {@link ManeuverDetector} description. * * @param earliestManeuverStart * maneuver start will not be before this time point; if a maneuver is found whose time point is at or @@ -245,7 +234,9 @@ public class ManeuverDetectorImpl implements ManeuverDetector { /** * Uses the provided {@code approximatingFixesToAnalyze} as douglas peucker fixes to detect maneuver spots with - * corresponding maneuvers. + * corresponding maneuvers. See step 2ff. in {@link ManeuverDetector} description. Maneuvers can only be expected to + * be detected if at least three fixes are provided in approximatedFixesToAnalyze. The first and the + * last DP-fix get never associated with a maneuver spot. */ protected List detectManeuvers(Iterable approximatingFixesToAnalyze, TimePoint earliestManeuverStart, TimePoint latestManeuverEnd) { @@ -289,10 +280,10 @@ public class ManeuverDetectorImpl implements ManeuverDetector { } /** - * Maps the provided {@code courseChange} from {@link Bearing} to {@link NauticalSide}. + * Maps the provided {@code courseChangeInDegrees} from {@link Bearing} to {@link NauticalSide}. */ - protected NauticalSide getDirectionOfCourseChange(Bearing courseChange) { - return courseChange.getDegrees() < 0 ? NauticalSide.PORT : NauticalSide.STARBOARD; + protected NauticalSide getDirectionOfCourseChange(double courseChangeInDegrees) { + return courseChangeInDegrees < 0 ? NauticalSide.PORT : NauticalSide.STARBOARD; } /** @@ -353,7 +344,7 @@ public class ManeuverDetectorImpl implements ManeuverDetector { } Bearing courseChangeOnOriginalFixes = getCourseChange(fromTimePointForCourseChangeAnalysis, toTimePointForCourseChangeAnalysis); - return getDirectionOfCourseChange(courseChangeOnOriginalFixes); + return getDirectionOfCourseChange(courseChangeOnOriginalFixes.getDegrees()); } /** @@ -400,15 +391,11 @@ public class ManeuverDetectorImpl implements ManeuverDetector { * maneuver and the leg after the maneuver is not taken from a later time point, even if half the * maneuver duration after the maneuver time point were after this time point. * @return The derived list maneuver spots with corresponding maneuvers. The maneuver spot count {@code >= 0}. - * @throws NoWindException - * When no wind information during maneuver performance is available - * @see #groupChangesInSameDirectionIntoManeuvers(Competitor, List, boolean, TimePoint, TimePoint) - * @see #computeManeuverDetails(Competitor, ManeuverCurveDetailsWithBearingSteps, TimePoint, TimePoint) */ protected ManeuverSpot createManeuverSpotWithManeuversFromFixesGroup(List douglasPeuckerFixesGroup, NauticalSide maneuverDirection, TimePoint earliestManeuverStart, TimePoint latestManeuverEnd) { - ManeuverCurve maneuverCurve = createManeuverCurveFromFixesGroup(douglasPeuckerFixesGroup, maneuverDirection, - earliestManeuverStart, latestManeuverEnd); + CompleteManeuverCurve maneuverCurve = createManeuverCurveFromFixesGroup(douglasPeuckerFixesGroup, + maneuverDirection, earliestManeuverStart, latestManeuverEnd); if (maneuverCurve == null) { return new ManeuverSpot(new ArrayList<>(douglasPeuckerFixesGroup), maneuverDirection, null, new ArrayList<>(), null); @@ -424,41 +411,25 @@ public class ManeuverDetectorImpl implements ManeuverDetector { } /** - * Creates maneuvers from the provided {@code group} of douglas peucker fixes considering the provided time range - * limit. This method might return zero or more maneuvers. The maneuvers are determined by the following work-flow: - *

        - *
      1. Main curve of maneuver within the time range of douglas peucker fixes +- - * ({@link BoatClass#getApproximateManeuverDuration() maneuver duration}{@code / 2}) is determined. The main curve - * is defined as the section of maneuver with the highest absolute course change towards the provided - * {@code maneuverDirection} ({@link Maneuver more info}).
      2. - *
      3. Maneuver start and end with stable speed and course are determined by analysis of speed maxima starting - * before and after the main curve, followed by extension to the points with stable course - * ({@link #computeManeuverDetails(Competitor, ManeuverCurveDetailsWithBearingSteps, TimePoint, TimePoint) more - * info})
      4. - *
      5. The maneuver type is determined considering the maneuver's main curve, marks and wind direction
      6. - *
      + * Determines the complete maneuver curve for the provided DP-fixes group. * * @param douglasPeuckerFixesGroup - * The douglas peucker fixes which may represent the maneuver basis + * The douglas peucker fixes which represents the basis points of the complete maneuver curve. * @param maneuverDirection * The course change direction within douglas peucker fixes. * @param earliestManeuverStart - * Maneuver start will not be before this time point; if a maneuver is found whose time point is at or - * after this time point, no matter how close it is, its start regarding speed and course into the + * Maneuver curve start will not be before this time point; if a maneuver is found whose time point is at + * or after this time point, no matter how close it is, its start regarding speed and course into the * maneuver and the leg before the maneuver is not taken from an earlier time point, even if half the * maneuver duration before the maneuver time point were before this time point. * @param latestManeuverEnd - * Maneuver end will not be after this time point; if a maneuver is found whose time point is at or + * Maneuver curve end will not be after this time point; if a maneuver is found whose time point is at or * before this time point, no matter how close it is, its end regarding speed and course out of the * maneuver and the leg after the maneuver is not taken from a later time point, even if half the * maneuver duration after the maneuver time point were after this time point. * @return The derived list maneuver spots with corresponding maneuvers. The maneuver spot count {@code >= 0}. - * @throws NoWindException - * When no wind information during maneuver performance is available - * @see #groupChangesInSameDirectionIntoManeuvers(Competitor, List, boolean, TimePoint, TimePoint) - * @see #computeManeuverDetails(Competitor, ManeuverCurveDetailsWithBearingSteps, TimePoint, TimePoint) */ - private ManeuverCurve createManeuverCurveFromFixesGroup(List douglasPeuckerFixesGroup, + private CompleteManeuverCurve createManeuverCurveFromFixesGroup(List douglasPeuckerFixesGroup, NauticalSide maneuverDirection, TimePoint earliestManeuverStart, TimePoint latestManeuverEnd) { long durationForDouglasPeuckerExtensionForMainCurveAnalysisInMillis = getDurationForDouglasPeuckerExtensionForMainCurveAnalysis( getApproximateManeuverDuration()).asMillis(); @@ -482,10 +453,15 @@ public class ManeuverDetectorImpl implements ManeuverDetector { ManeuverCurveDetails maneuverDetails = computeManeuverDetails(maneuverMainCurveDetails, earliestManeuverStart, latestManeuverEnd); MarkPassing markPassing = getMarkPassingIfPresent(maneuverMainCurveDetails); - ManeuverCurve maneuverCurve = new ManeuverCurveImpl(maneuverMainCurveDetails, maneuverDetails, markPassing); + CompleteManeuverCurve maneuverCurve = new ManeuverCurveImpl(maneuverMainCurveDetails, maneuverDetails, + markPassing); return maneuverCurve; } + /** + * Gets the mark passing performed within the provided maneuver curve boundaries. {@code null} is returned when no + * mark passing is present. + */ private MarkPassing getMarkPassingIfPresent(ManeuverCurveBoundaries maneuverCurveBoundaries) { // the TrackedLegOfCompetitor variables may be null, e.g., in case the time points are before or after the race TrackedLegOfCompetitor legBeforeManeuver = trackedRace.getTrackedLeg(competitor, @@ -505,6 +481,11 @@ public class ManeuverDetectorImpl implements ManeuverDetector { return markPassing; } + /** + * Derives maneuvers from the provided maneuver main curve and maneuver curve with stable speed and course before + * and after. This method gets called recursively if the splitting of main curve and maneuver curve boundaries is + * performed in order to extract multiple maneuvers for one complete maneuver curve. + */ protected List determineManeuversFromManeuverCurve( ManeuverCurveDetailsWithBearingSteps maneuverMainCurveDetails, ManeuverCurveDetails maneuverDetails, Wind wind, MarkPassing markPassing) { @@ -667,8 +648,8 @@ public class ManeuverDetectorImpl implements ManeuverDetector { ManeuverCurveDetailsWithBearingSteps maneuverMainCurveDetails, TimePoint timePoint) { Pair splitSteps = splitSpeedWithBearingStepsByTimePoint( maneuverMainCurveDetails.getSpeedWithBearingSteps(), timePoint); - NauticalSide maneuverDirection = maneuverMainCurveDetails.getDirectionChangeInDegrees() < 0 ? NauticalSide.PORT - : NauticalSide.STARBOARD; + NauticalSide maneuverDirection = getDirectionOfCourseChange( + maneuverMainCurveDetails.getDirectionChangeInDegrees()); SpeedWithBearingStepsIterable stepsBeforeIterable = splitSteps.getA(); ManeuverCurveDetailsWithBearingSteps mainCurveBefore = stepsBeforeIterable == null ? null : constructManeuverCurveDetailsWithBearingSteps( diff --git a/java/com.sap.sailing.domain/src/com/sap/sailing/domain/maneuverdetection/impl/ManeuverSpot.java b/java/com.sap.sailing.domain/src/com/sap/sailing/domain/maneuverdetection/impl/ManeuverSpot.java index 085fe357db0..1511401a289 100644 --- a/java/com.sap.sailing.domain/src/com/sap/sailing/domain/maneuverdetection/impl/ManeuverSpot.java +++ b/java/com.sap.sailing.domain/src/com/sap/sailing/domain/maneuverdetection/impl/ManeuverSpot.java @@ -3,7 +3,7 @@ package com.sap.sailing.domain.maneuverdetection.impl; import com.sap.sailing.domain.common.NauticalSide; import com.sap.sailing.domain.common.tracking.GPSFixMoving; import com.sap.sailing.domain.tracking.Maneuver; -import com.sap.sailing.domain.tracking.ManeuverCurve; +import com.sap.sailing.domain.tracking.CompleteManeuverCurve; /** * Represents a spot within the track of competitor, where maneuvers have been detected by analysis of a douglas peucker @@ -17,12 +17,12 @@ public class ManeuverSpot { private final Iterable douglasPeuckerFixes; private final NauticalSide maneuverSpotDirection; - private final ManeuverCurve maneuverCurve; + private final CompleteManeuverCurve maneuverCurve; private final Iterable maneuvers; private final WindMeasurement windMeasurement; public ManeuverSpot(Iterable douglasPeuckerFixes, NauticalSide maneuverSpotDirection, - ManeuverCurve maneuverCurve, Iterable maneuvers, WindMeasurement windMeasurement) { + CompleteManeuverCurve maneuverCurve, Iterable maneuvers, WindMeasurement windMeasurement) { this.douglasPeuckerFixes = douglasPeuckerFixes; this.maneuverCurve = maneuverCurve; this.maneuvers = maneuvers; @@ -44,7 +44,7 @@ public class ManeuverSpot { return maneuverSpotDirection; } - public ManeuverCurve getManeuverCurve() { + public CompleteManeuverCurve getManeuverCurve() { return maneuverCurve; } diff --git a/java/com.sap.sailing.domain/src/com/sap/sailing/domain/tracking/ManeuverCurve.java b/java/com.sap.sailing.domain/src/com/sap/sailing/domain/tracking/CompleteManeuverCurve.java similarity index 62% rename from java/com.sap.sailing.domain/src/com/sap/sailing/domain/tracking/ManeuverCurve.java rename to java/com.sap.sailing.domain/src/com/sap/sailing/domain/tracking/CompleteManeuverCurve.java index 213744e0aa1..792759a87fc 100644 --- a/java/com.sap.sailing.domain/src/com/sap/sailing/domain/tracking/ManeuverCurve.java +++ b/java/com.sap.sailing.domain/src/com/sap/sailing/domain/tracking/CompleteManeuverCurve.java @@ -4,17 +4,20 @@ import com.sap.sailing.domain.maneuverdetection.impl.ManeuverCurveDetails; import com.sap.sailing.domain.maneuverdetection.impl.ManeuverCurveDetailsWithBearingSteps; /** + * Represents a segment within a GPS-track where a maneuver is performed. In contrast to {@link Maneuver}, the + * boundaries of the curve are not split by maneuver type dependent logic, e.g. by cutting of the first 360 degrees of + * penalty circles and etc. * * @author Vladislav Chumak (D069712) * */ -public interface ManeuverCurve { +public interface CompleteManeuverCurve { /** * Gets time points and speeds with bearings of main curve beginning and end. * * @return Entering and exiting details of maneuver main curve - * @see ManeuverCurve + * @see CompleteManeuverCurve */ ManeuverCurveDetailsWithBearingSteps getMainCurveBoundaries(); @@ -24,12 +27,19 @@ public interface ManeuverCurve { * * @return Entering and exiting details of maneuver section, with stable speed and bearing before and after that * section - * @see ManeuverCurve + * @see CompleteManeuverCurve */ ManeuverCurveDetails getManeuverCurveWithStableSpeedAndCourseBoundaries(); + /** + * Gets the mark passing which is contained within maneuver curve. In case if no mark was passed, {@code null} is + * returned. + */ MarkPassing getMarkPassing(); + /** + * Determines whether a mark was crossed within the maneuver curve. + */ boolean isMarkPassing(); } diff --git a/java/com.sap.sailing.domain/src/com/sap/sailing/domain/tracking/Maneuver.java b/java/com.sap.sailing.domain/src/com/sap/sailing/domain/tracking/Maneuver.java index 481d95885f4..d3a9826e29e 100755 --- a/java/com.sap.sailing.domain/src/com/sap/sailing/domain/tracking/Maneuver.java +++ b/java/com.sap.sailing.domain/src/com/sap/sailing/domain/tracking/Maneuver.java @@ -144,7 +144,7 @@ public interface Maneuver extends GPSFix { Speed getLowestSpeed(); /** - * Gets the mark passing which is contained within maneuver. In case if no mark passing was passed, {@code null} is + * Gets the mark passing which is contained within maneuver curve. In case if no mark was passed, {@code null} is * returned. */ MarkPassing getMarkPassing(); diff --git a/java/com.sap.sailing.domain/src/com/sap/sailing/domain/tracking/impl/ManeuverCurveImpl.java b/java/com.sap.sailing.domain/src/com/sap/sailing/domain/tracking/impl/ManeuverCurveImpl.java index 8006aeb19ad..8eb459e3083 100644 --- a/java/com.sap.sailing.domain/src/com/sap/sailing/domain/tracking/impl/ManeuverCurveImpl.java +++ b/java/com.sap.sailing.domain/src/com/sap/sailing/domain/tracking/impl/ManeuverCurveImpl.java @@ -2,14 +2,14 @@ package com.sap.sailing.domain.tracking.impl; import com.sap.sailing.domain.maneuverdetection.impl.ManeuverCurveDetails; import com.sap.sailing.domain.maneuverdetection.impl.ManeuverCurveDetailsWithBearingSteps; -import com.sap.sailing.domain.tracking.ManeuverCurve; +import com.sap.sailing.domain.tracking.CompleteManeuverCurve; import com.sap.sailing.domain.tracking.MarkPassing; /** * @author Vladislav Chumak (D069712) * */ -public class ManeuverCurveImpl implements ManeuverCurve { +public class ManeuverCurveImpl implements CompleteManeuverCurve { private final ManeuverCurveDetailsWithBearingSteps mainCurveBoundaries; private final ManeuverCurveDetails maneuverCurveWithStableSpeedAndCourseBoundaries;