java/com.sap.sailing.domain/src/com/sap/sailing/domain/maneuverdetection/impl/ManeuverDetectorImpl.java
... ...
@@ -190,7 +190,7 @@ public class ManeuverDetectorImpl extends AbstractManeuverDetectorImpl {
190 190
* Checks whether {@code currentFix} can be grouped together with the previous fixes in order to be regarded as a
191 191
* single maneuver spot. For this, the {@code newCourseChangeDirection must match the direction of provided {@code
192 192
* lastCourseChangeDirection}. Additionally, the distance from {@code previousFix} to {@code currentFix} must be <=
193
- * 3 hull lengths, or the time difference <= getApproximatedManeuverDuration().
193
+ * 5 hull lengths, or the time difference <= 2*getApproximatedManeuverDuration().
194 194
*
195 195
* @param lastCourseChangeDirection The last course within previous three fixes counting from {@code currentFix}
196 196
*
... ...
@@ -205,17 +205,20 @@ public class ManeuverDetectorImpl extends AbstractManeuverDetectorImpl {
205 205
*/
206 206
protected boolean checkDouglasPeuckerFixesGroupable(NauticalSide lastCourseChangeDirection,
207 207
NauticalSide newCourseChangeDirection, GPSFixMoving previousFix, GPSFixMoving currentFix) {
208
+ final boolean result;
208 209
if (lastCourseChangeDirection != newCourseChangeDirection) {
209
- return false;
210
- }
211
- Distance threeHullLengths = trackedRace.getRace().getBoatOfCompetitor(competitor).getBoatClass().getHullLength()
212
- .scale(3);
213
- if (currentFix.getTimePoint().asMillis()
214
- - previousFix.getTimePoint().asMillis() > getApproximateManeuverDuration().asMillis()
215
- && currentFix.getPosition().getDistance(previousFix.getPosition()).compareTo(threeHullLengths) > 0) {
216
- return false;
210
+ result = false;
211
+ } else {
212
+ Distance threeHullLengths = trackedRace.getRace().getBoatOfCompetitor(competitor).getBoatClass().getHullLength().scale(5);
213
+ if (currentFix.getTimePoint().asMillis()
214
+ - previousFix.getTimePoint().asMillis() > getApproximateManeuverDuration().asMillis()*2
215
+ && currentFix.getPosition().getDistance(previousFix.getPosition()).compareTo(threeHullLengths) > 0) {
216
+ result = false;
217
+ } else {
218
+ result = true;
219
+ }
217 220
}
218
- return true;
221
+ return result;
219 222
}
220 223
221 224
private List<Maneuver> getAllManeuversFromManeuverSpots(List<? extends ManeuverSpot> maneuverSpots) {