From 9cd46dc4cc4d9f2c2fa4ce219db16b726ee8007a Mon Sep 17 00:00:00 2001 From: Sven Czarnian Date: Thu, 11 Nov 2021 23:22:41 +0100 Subject: [PATCH] extend the arrival candidates --- aman/types/Inbound.py | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/aman/types/Inbound.py b/aman/types/Inbound.py index 59ad9af..4cd3799 100644 --- a/aman/types/Inbound.py +++ b/aman/types/Inbound.py @@ -61,15 +61,17 @@ class Inbound: flightTime, flightTimeUntilIaf, trackmiles, arrivalRoute = self.arrivalEstimation(identifier.Runway, star, weatherModel) avgSpeed = trackmiles / (float(flightTime.seconds) / 3600.0) - ttg = flightTime - timedelta(minutes = (trackmiles / (avgSpeed * 1.1)) * 60) - ttl = timedelta(minutes = (trackmiles / (avgSpeed * 0.9)) * 60) - flightTime + # the closer we get to the IAF the less time delta can be achieved by short cuts, delay vectors or speeds + ratio = min(2.0, max(0.0, self.Report.distanceToIAF / (trackmiles - self.Report.distanceToIAF))) + possibleTimeDelta = (trackmiles / (avgSpeed * 0.9)) * 60 + timeDelta = timedelta(minutes = (possibleTimeDelta - flightTime.total_seconds() / 60) * ratio) ita = self.ReportTime + flightTime - earliest = ita - ttg - latest = ita + ttl + earliest = ita - timeDelta + latest = ita + timeDelta - self.ArrivalCandidates[identifier.Runway.Name] = ArrivalData(ttg = ttg, star = star, ita = ita, earliest = earliest, + self.ArrivalCandidates[identifier.Runway.Name] = ArrivalData(ttg = timeDelta, star = star, ita = ita, earliest = earliest, entry = flightTimeUntilIaf, touchdown = flightTime, - ttl = ttl, latest = latest) + ttl = timeDelta, latest = latest, route = arrivalRoute, trackmiles = trackmiles) # calculate the first values for later plannings for candidate in self.ArrivalCandidates: