diff --git a/aman/sys/RecedingHorizonControl.py b/aman/sys/RecedingHorizonControl.py index 70c8c3b..5803d13 100644 --- a/aman/sys/RecedingHorizonControl.py +++ b/aman/sys/RecedingHorizonControl.py @@ -31,7 +31,6 @@ class RecedingHorizonControl: plannedInbound = self.Windows[index].inbound(inbound.Report.aircraft.callsign) plannedInbound.CurrentPosition = inbound.CurrentPosition - plannedInbound.MaximumTimeToGain = inbound.MaximumTimeToGain plannedInbound.ArrivalCandidates = inbound.ArrivalCandidates # check if we need to update the inbound diff --git a/aman/types/Inbound.py b/aman/types/Inbound.py index de63df5..6c3173a 100644 --- a/aman/types/Inbound.py +++ b/aman/types/Inbound.py @@ -178,6 +178,6 @@ class Inbound: if nextWaypointIndex < len(star.Route): distanceToWaypoint = star.Route[lastWaypointIndex].haversine(star.Route[nextWaypointIndex]) * 0.539957 currentHeading = star.Route[lastWaypointIndex].bearing(star.Route[nextWaypointIndex]) - currentPosition[1] = min(weather.calculateGS(newAltitude, currentIAS, currentHeading), currentPosition[1]) + currentPosition[1] = min(weather.calculateGS(currentPosition[0], currentIAS, currentHeading), currentPosition[1]) return timedelta(seconds = flightTimeSeconds), timedelta(seconds = flightTimeUntilIafSeconds), trackmiles