mirror of
https://github.com/eclipse-sailing-analytics/sailing-analytics.git
synced 2026-10-16 09:11:02 +00:00
Merge branch 'master' into textbox
This commit is contained in:
commit
ece5e747fa
2 files changed
+34
-24
No files matched your search
+20
-16
@@ -586,21 +586,25 @@ public class TrackedLegOfCompetitorImpl implements TrackedLegOfCompetitor {
|
|||||||
if (speedWhenSpeedStartedToDrop != null) {
|
if (speedWhenSpeedStartedToDrop != null) {
|
||||||
TimePoint timePointWhenSpeedLevelledOffAfterManeuver = fixes.get(fixes.size()-1).getTimePoint();
|
TimePoint timePointWhenSpeedLevelledOffAfterManeuver = fixes.get(fixes.size()-1).getTimePoint();
|
||||||
SpeedWithBearing speedAfterManeuver = track.getEstimatedSpeed(timePointWhenSpeedLevelledOffAfterManeuver);
|
SpeedWithBearing speedAfterManeuver = track.getEstimatedSpeed(timePointWhenSpeedLevelledOffAfterManeuver);
|
||||||
// For upwind/downwind legs, find the mean course between inbound and outbound course and project actual and
|
if (speedAfterManeuver != null) {
|
||||||
// extrapolated positions onto it:
|
// For upwind/downwind legs, find the mean course between inbound and outbound course and project actual and
|
||||||
Bearing middleManeuverAngle = speedWhenSpeedStartedToDrop.getBearing().middle(speedAfterManeuver.getBearing());
|
// extrapolated positions onto it:
|
||||||
// extrapolate maximum speed before maneuver to time point of maximum speed after maneuver and project resulting position
|
Bearing middleManeuverAngle = speedWhenSpeedStartedToDrop.getBearing().middle(speedAfterManeuver.getBearing());
|
||||||
// onto the average maneuver course; compare to the projected position actually reached at the time point of maximum speed after
|
// extrapolate maximum speed before maneuver to time point of maximum speed after maneuver and project resulting position
|
||||||
// maneuver:
|
// onto the average maneuver course; compare to the projected position actually reached at the time point of maximum speed after
|
||||||
Position positionWhenSpeedStartedToDrop = track.getEstimatedPosition(timePointWhenSpeedStartedToDrop, /* extrapolate */ false);
|
// maneuver:
|
||||||
Position extrapolatedPositionAtTimePointOfMaxSpeedAfterManeuver =
|
Position positionWhenSpeedStartedToDrop = track.getEstimatedPosition(timePointWhenSpeedStartedToDrop, /* extrapolate */ false);
|
||||||
speedWhenSpeedStartedToDrop.travelTo(positionWhenSpeedStartedToDrop, timePointWhenSpeedStartedToDrop, timePointWhenSpeedLevelledOffAfterManeuver);
|
Position extrapolatedPositionAtTimePointOfMaxSpeedAfterManeuver =
|
||||||
Position actualPositionAtTimePointOfMaxSpeedAfterManeuver = track.getEstimatedPosition(timePointWhenSpeedLevelledOffAfterManeuver, /* extrapolate */ false);
|
speedWhenSpeedStartedToDrop.travelTo(positionWhenSpeedStartedToDrop, timePointWhenSpeedStartedToDrop, timePointWhenSpeedLevelledOffAfterManeuver);
|
||||||
Position projectedExtrapolatedPositionAtTimePointOfMaxSpeedAfterManeuver =
|
Position actualPositionAtTimePointOfMaxSpeedAfterManeuver = track.getEstimatedPosition(timePointWhenSpeedLevelledOffAfterManeuver, /* extrapolate */ false);
|
||||||
extrapolatedPositionAtTimePointOfMaxSpeedAfterManeuver.projectToLineThrough(positionWhenSpeedStartedToDrop, middleManeuverAngle);
|
Position projectedExtrapolatedPositionAtTimePointOfMaxSpeedAfterManeuver =
|
||||||
Position projectedActualPositionAtTimePointOfMaxSpeedAfterManeuver =
|
extrapolatedPositionAtTimePointOfMaxSpeedAfterManeuver.projectToLineThrough(positionWhenSpeedStartedToDrop, middleManeuverAngle);
|
||||||
actualPositionAtTimePointOfMaxSpeedAfterManeuver.projectToLineThrough(positionWhenSpeedStartedToDrop, middleManeuverAngle);
|
Position projectedActualPositionAtTimePointOfMaxSpeedAfterManeuver =
|
||||||
result = projectedActualPositionAtTimePointOfMaxSpeedAfterManeuver.getDistance(projectedExtrapolatedPositionAtTimePointOfMaxSpeedAfterManeuver);
|
actualPositionAtTimePointOfMaxSpeedAfterManeuver.projectToLineThrough(positionWhenSpeedStartedToDrop, middleManeuverAngle);
|
||||||
|
result = projectedActualPositionAtTimePointOfMaxSpeedAfterManeuver.getDistance(projectedExtrapolatedPositionAtTimePointOfMaxSpeedAfterManeuver);
|
||||||
|
} else {
|
||||||
|
result = null;
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
result = null;
|
result = null;
|
||||||
}
|
}
|
||||||
@@ -641,7 +645,7 @@ public class TrackedLegOfCompetitorImpl implements TrackedLegOfCompetitor {
|
|||||||
while (fixIter.hasNext()) {
|
while (fixIter.hasNext()) {
|
||||||
fix = fixIter.next();
|
fix = fixIter.next();
|
||||||
final SpeedWithBearing estimatedSpeedAtFix = track.getEstimatedSpeed(fix.getTimePoint());
|
final SpeedWithBearing estimatedSpeedAtFix = track.getEstimatedSpeed(fix.getTimePoint());
|
||||||
if (lastFix != null) {
|
if (lastFix != null && lastSpeed != null && lastLastSpeed != null && estimatedSpeedAtFix != null) {
|
||||||
if (lastSpeed.compareTo(lastLastSpeed) > 0 && lastSpeed.compareTo(estimatedSpeedAtFix) > 0) {
|
if (lastSpeed.compareTo(lastLastSpeed) > 0 && lastSpeed.compareTo(estimatedSpeedAtFix) > 0) {
|
||||||
maxima.add(lastFix);
|
maxima.add(lastFix);
|
||||||
} else if (lastSpeed.compareTo(lastLastSpeed) < 0 && lastSpeed.compareTo(estimatedSpeedAtFix) < 0) {
|
} else if (lastSpeed.compareTo(lastLastSpeed) < 0 && lastSpeed.compareTo(estimatedSpeedAtFix) < 0) {
|
||||||
|
|||||||
+14
-8
@@ -2259,14 +2259,20 @@ public abstract class TrackedRaceImpl implements TrackedRace, CourseListener {
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
if (lastFix != null) {
|
if (lastFix != null) {
|
||||||
Bearing courseAtLastFix = track.getEstimatedSpeed(lastFix.getTimePoint()).getBearing();
|
final SpeedWithBearing lastEstimatedSpeed = track.getEstimatedSpeed(lastFix.getTimePoint());
|
||||||
Bearing courseAtFix = track.getEstimatedSpeed(fix.getTimePoint()).getBearing();
|
if (lastEstimatedSpeed != null) {
|
||||||
double angleSpeedInDegreesPerSecond = Math.abs((courseAtFix.getDifferenceTo(courseAtLastFix)
|
Bearing courseAtLastFix = lastEstimatedSpeed.getBearing();
|
||||||
.getDegrees())
|
final SpeedWithBearing estimatedSpeed = track.getEstimatedSpeed(fix.getTimePoint());
|
||||||
/ (double) (fix.getTimePoint().asMillis() - lastFix.getTimePoint().asMillis()));
|
if (estimatedSpeed != null) {
|
||||||
if (angleSpeedInDegreesPerSecond > maxAngleSpeedInDegreesPerSecond) {
|
Bearing courseAtFix = estimatedSpeed.getBearing();
|
||||||
maxAngleSpeedInDegreesPerSecond = angleSpeedInDegreesPerSecond;
|
double angleSpeedInDegreesPerSecond = Math.abs((courseAtFix
|
||||||
result = lastFix.getTimePoint();
|
.getDifferenceTo(courseAtLastFix).getDegrees())
|
||||||
|
/ (double) (fix.getTimePoint().asMillis() - lastFix.getTimePoint().asMillis()));
|
||||||
|
if (angleSpeedInDegreesPerSecond > maxAngleSpeedInDegreesPerSecond) {
|
||||||
|
maxAngleSpeedInDegreesPerSecond = angleSpeedInDegreesPerSecond;
|
||||||
|
result = lastFix.getTimePoint();
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
lastFix = fix;
|
lastFix = fix;
|
||||||
|
|||||||
Reference in new issue
Block a user