fix parts in the runway manager

This commit is contained in:
Sven Czarnian
2021-11-10 22:44:55 +01:00
parent ccb3774872
commit dd9e725fc2

View File

@@ -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