|
@@ -5,6 +5,7 @@ import sys
|
|
|
|
|
|
from datetime import datetime, timedelta
|
|
|
|
|
|
+from aman.config.Airport import Airport
|
|
|
from aman.config.AirportSequencing import AirportSequencing
|
|
|
from aman.formats.SctEseFormat import SctEseFormat
|
|
|
from aman.sys.WeatherModel import WeatherModel
|
|
@@ -150,7 +151,7 @@ class Node:
|
|
|
return timedelta(seconds = flightTimeSeconds), trackmiles, arrivalRoute, timedelta(seconds = flightTimeOnStarSeconds)
|
|
|
|
|
|
def __init__(self, inbound : Inbound, referenceTime : datetime, weatherModel : WeatherModel,
|
|
|
- navData : SctEseFormat, sequencingConfig : AirportSequencing):
|
|
|
+ airportConfig : Airport, sequencingConfig : AirportSequencing):
|
|
|
self.PredictedDistanceToIAF = inbound.Report.distanceToIAF
|
|
|
self.PredictedCoordinate = [ inbound.CurrentPosition.latitude, inbound.CurrentPosition.longitude ]
|
|
|
self.PredictionTime = referenceTime
|
|
@@ -171,7 +172,7 @@ class Node:
|
|
|
prediction = tempWaypoint.project(course, distance)
|
|
|
|
|
|
# calculate the bearing between the current position and the IAF
|
|
|
- star = Node.findArrivalRoute(inbound.Report.initialApproachFix, sequencingConfig.ActiveArrivalRunways[0].Runway, navData)
|
|
|
+ star = Node.findArrivalRoute(inbound.Report.initialApproachFix, sequencingConfig.ActiveArrivalRunways[0].Runway, airportConfig.GngData)
|
|
|
|
|
|
# calculate the distance based on the flown distance and update the predicted distance
|
|
|
if None != star:
|
|
@@ -187,7 +188,7 @@ class Node:
|
|
|
|
|
|
# calculate the timings for the different arrival runways
|
|
|
for identifier in sequencingConfig.ActiveArrivalRunways:
|
|
|
- star = Node.findArrivalRoute(self.Inbound.Report.initialApproachFix, identifier.Runway, navData)
|
|
|
+ star = Node.findArrivalRoute(self.Inbound.Report.initialApproachFix, identifier.Runway, airportConfig.GngData)
|
|
|
|
|
|
if None != star:
|
|
|
flightTime, trackmiles, arrivalRoute, flightTimeOnStar = self.arrivalEstimation(identifier.Runway, star, weatherModel)
|
|
@@ -203,8 +204,16 @@ class Node:
|
|
|
timeUntilIAF = timedelta(seconds = 0)
|
|
|
|
|
|
# the best TTL is the longest path with the slowest speed
|
|
|
- # TODO use configurations to define the maximum time gain
|
|
|
- ttg = timedelta(seconds = timeUntilIAF.total_seconds() * 0.2)
|
|
|
+ ttgMax = 60
|
|
|
+ ttgRatio = 0.05
|
|
|
+ if star.Name in airportConfig.OptimizationParameters:
|
|
|
+ ttgMax = airportConfig.OptimizationParameters[star.Name][0]
|
|
|
+ ttgRatio = airportConfig.OptimizationParameters[star.Name][1]
|
|
|
+
|
|
|
+ ttg = timedelta(seconds = timeUntilIAF.total_seconds() * ttgRatio)
|
|
|
+ if (ttg.total_seconds() > ttgMax):
|
|
|
+ ttg = timedelta(seconds = ttgMax)
|
|
|
+ print(self.Inbound.Callsign + ': ' + str(ttg))
|
|
|
ttl = timedelta(seconds = decreasedSpeedFlighttime - flightTime.total_seconds())
|
|
|
ita = self.Inbound.ReportTime + flightTime
|
|
|
earliest = ita - ttg
|