From dd9e725fc20ac10322b8c93b49f3d81c4b6a9cc8 Mon Sep 17 00:00:00 2001 From: Sven Czarnian Date: Wed, 10 Nov 2021 22:44:55 +0100 Subject: [PATCH] fix parts in the runway manager --- aman/sys/aco/RunwayManager.py | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/aman/sys/aco/RunwayManager.py b/aman/sys/aco/RunwayManager.py index efa120f..6663a19 100644 --- a/aman/sys/aco/RunwayManager.py +++ b/aman/sys/aco/RunwayManager.py @@ -20,7 +20,7 @@ class RunwayManager: if not runway.Runway.Name in self.RunwayInbounds: self.RunwayInbounds[runway.Runway.Name] = None - def calculateEarliestArrivalTime(self, runway : str, inbound : Inbound, useITA : bool, earliestArrivalTime : datetime): + def calculateEarliestArrivalTime(self, runway : str, inbound : Inbound, useETA : bool, earliestArrivalTime : datetime): constrainedETA = None if None != self.RunwayInbounds[runway]: @@ -37,12 +37,13 @@ class RunwayManager: # calculate the arrival times for the dependent inbounds for dependentRunway in self.Configuration.RunwayConstraints.findDependentRunways(runway): if None != self.RunwayInbounds[dependentRunway.Runway.Name]: + # TODO staggered spacing variabel candidate = self.RunwayInbounds[dependentRunway.Runway.Name].PlannedArrivalTime + timedelta(minutes = 3 / (inbound.PerformanceData.SpeedApproach / 60)) if None == constrainedETA or candidate > constrainedETA: constrainedETA = candidate # get the arrival time on the runway of the inbound - if True == useITA: + if True == useETA: arrivalTime = inbound.ArrivalCandidates[runway].EarliestArrivalTime else: arrivalTime = inbound.ArrivalCandidates[runway].InitialArrivalTime @@ -56,7 +57,7 @@ class RunwayManager: else: return eta, timedelta(seconds = 0) - def selectArrivalRunway(self, inbound : Inbound, useITA : bool, earliestArrivalTime : datetime): + def selectArrivalRunway(self, inbound : Inbound, useETA : bool, earliestArrivalTime : datetime): availableRunways = self.Configuration.RunwayConstraints.ActiveArrivalRunways #if 1 < len(availableRunways): @@ -67,7 +68,7 @@ class RunwayManager: # fallback to check if we have available runways if 0 == len(availableRunways): runway = self.Configuration.RunwayConstraints.ActiveArrivalRunways[0] - return runway, self.calculateEarliestArrivalTime(runway.Runway.Name, inbound, useITA, earliestArrivalTime) + return runway, self.calculateEarliestArrivalTime(runway.Runway.Name, inbound, useETA, earliestArrivalTime) # start with the beginning selectedRunway = None @@ -76,7 +77,7 @@ class RunwayManager: # get the runway with the earliest ETA for runway in availableRunways: - candidate, delta = self.calculateEarliestArrivalTime(runway.Runway.Name, inbound, useITA, earliestArrivalTime) + candidate, delta = self.calculateEarliestArrivalTime(runway.Runway.Name, inbound, useETA, earliestArrivalTime) if None == eta or eta > candidate: selectedRunway = runway.Runway lostTime = delta