// Calibration contain methods for finding and validating factors transforming GPS coordinates to meters. // ToDo: make static public static bool ShouldAltBeUsed(TrainingSession ts) { Calibration calibrationWithAlt = new Calibration(true); List <TickDiffPair> calibrationSet = calibrationWithAlt.FindCandidates(ts, 100); List <TickDiffPair> validationSet = calibrationWithAlt.FindCandidates(ts, 100); ConversionFactors estimationWithAlt = calibrationWithAlt.CalibrateIteratively(calibrationSet, validationSet); double errorWithAlt = calibrationWithAlt.CalculateCalibrationError(estimationWithAlt, validationSet); Calibration calibrationWithoutAlt = new Calibration(false); ConversionFactors estimationWithoutAlt = calibrationWithoutAlt.CalibrateIteratively(calibrationSet, validationSet); double errorWithoutAlt = calibrationWithAlt.CalculateCalibrationError(estimationWithoutAlt, validationSet); return(errorWithAlt < errorWithoutAlt); }