Fixed the forgotten check for course change of maneuvers as prerequisite

to include the maneuvers in the set of clean maneuvers eligible for wind
estimation graph
This commit is contained in:
Vladislav Chumak
2019-05-24 10:48:25 +02:00
parent 9f40770c6e
commit 9606dbba5a
3 changed files with 16 additions and 5 deletions
@@ -19,6 +19,12 @@ public class IntersectedWindRangeBasedTransitionProbabilitiesCalculator
implements GraphNodeTransitionProbabilitiesCalculator {
private static final double LA_PLACE_TRANSITION_PROBABILITY = 0.001;
// TODO make the value below boat class specific?
/**
* Sum of the smallest possible absolute TWA upwind and smallest possible (180 deg - absolute TWA downwind). The
* amount is used to limit the possible wind range considering head-up and bear-away maneuvers.
*/
protected static final int MIN_BEATING_ANGLE_PLUS_MIN_RUNNING_ANGLE = 40;
private static final double MAX_ABS_WIND_COURSE_DEVIATION_TOLERANCE_WITHIN_ANALYSIS_INTERVAL_IN_DEGREES = 40;
protected final boolean propagateIntersectedWindRangeOfHeadupAndBearAway;
@@ -109,7 +109,9 @@ public class ManeuverForEstimationTransformer
}
public boolean isManeuverClean(ConvertableToManeuverForEstimation maneuver) {
return isManeuverBoundariesDataClean(maneuver, true, true)
return isManeuverEligibleForAnalysis(maneuver.getCourseChangeInDegrees(),
maneuver.getCourseChangeInDegreesWithinTurningSection())
&& isManeuverBoundariesDataClean(maneuver, true, true)
&& Math.abs(maneuver.getSpeedWithBearingBefore().getKnots()
- maneuver.getSpeedWithBearingAfter().getKnots())
* 3 < Math.min(maneuver.getSpeedWithBearingBefore().getKnots(),
@@ -123,8 +125,10 @@ public class ManeuverForEstimationTransformer
return getManeuverCategory(maneuver.getCourseChangeInDegreesWithinTurningSection(), maneuver.isMarkPassing());
}
public boolean isManeuverEligibleForAnalysis(double courseChangeWithinTurningSectionInDegrees) {
return getManeuverCategory(courseChangeWithinTurningSectionInDegrees, false) == ManeuverCategory.REGULAR;
public boolean isManeuverEligibleForAnalysis(double courseChangeInDegrees,
double courseChangeWithinTurningSectionInDegrees) {
return getManeuverCategory(courseChangeWithinTurningSectionInDegrees, false) == ManeuverCategory.REGULAR
&& getManeuverCategory(courseChangeInDegrees, false) == ManeuverCategory.REGULAR;
}
public ManeuverCategory getManeuverCategory(double courseChangeWithinTurningSectionInDegrees, boolean markPassing) {
@@ -44,8 +44,9 @@ public class CompleteManeuverCurveToManeuverForEstimationConverter {
public ManeuverForEstimation convertCleanManeuverSpotToManeuverForEstimation(CompleteManeuverCurve maneuver,
CompleteManeuverCurve previousManeuver, CompleteManeuverCurve nextManeuver, Competitor competitor,
TrackTimeInfo trackTimeInfo) {
if (!maneuverForEstimationTransformer
.isManeuverEligibleForAnalysis(maneuver.getMainCurveBoundaries().getDirectionChangeInDegrees())) {
if (!maneuverForEstimationTransformer.isManeuverEligibleForAnalysis(
maneuver.getManeuverCurveWithStableSpeedAndCourseBoundaries().getDirectionChangeInDegrees(),
maneuver.getMainCurveBoundaries().getDirectionChangeInDegrees())) {
// skip further computation in order to improve performance performance
return null;
}