do not double optimize the speed until IAF two times

This commit is contained in:
Sven Czarnian
2021-10-13 21:47:45 +02:00
parent 44837e59f1
commit 9f6c9f1ff8

View File

@@ -31,10 +31,8 @@ class Inbound:
flightTime, flightTimeUntilIaf, trackmiles = self.secondsUntilTouchdown(weatherModel)
# calculate the maximum time to gain (assumption: 10% speed increase by acceleration and shortcuts)
avgSpeed = self.Report.distanceToIAF / (float(flightTimeUntilIaf.seconds) / 3600.0)
self.MaximumTimeToGain = flightTimeUntilIaf - timedelta(minutes = (self.Report.distanceToIAF / (avgSpeed * 1.1)) * 60)
avgSpeed = trackmiles / (float(flightTime.seconds) / 3600.0)
self.MaximumTimeToGain += flightTime - timedelta(minutes = (trackmiles / (avgSpeed * 1.1)) * 60)
self.MaximumTimeToGain = flightTime - timedelta(minutes = (trackmiles / (avgSpeed * 1.1)) * 60)
# calculate the different arrival times
self.InitialArrivalTime = self.ReportTime + flightTime