|
@@ -221,7 +221,40 @@ class Airport:
|
|
else:
|
|
else:
|
|
dictionary[runway][key].extend(assignments[key])
|
|
dictionary[runway][key].extend(assignments[key])
|
|
|
|
|
|
|
|
+ def parseOptimization(self, key : str, line : str):
|
|
|
|
+ star = key.replace('optimization', '').upper()
|
|
|
|
+
|
|
|
|
+ # check if the STAR exists
|
|
|
|
+ found = False
|
|
|
|
+ for rwy in self.GngData.ArrivalRoutes:
|
|
|
|
+ for route in self.GngData.ArrivalRoutes[rwy]:
|
|
|
|
+ if star == route.Name:
|
|
|
|
+ found = True
|
|
|
|
+ break
|
|
|
|
+ if True == found:
|
|
|
|
+ break
|
|
|
|
+
|
|
|
|
+ if False == found:
|
|
|
|
+ sys.stderr.write('Unknown star:' + key)
|
|
|
|
+ raise Exception()
|
|
|
|
+
|
|
|
|
+ elements = line.split(':')
|
|
|
|
+ if 2 != len(elements):
|
|
|
|
+ sys.stderr.write('Invalid optimization parameter for ' + key)
|
|
|
|
+ raise Exception()
|
|
|
|
+
|
|
|
|
+ maxTTG = int(elements[0])
|
|
|
|
+ ttgRatio = float(elements[1])
|
|
|
|
+
|
|
|
|
+ return star, maxTTG, ttgRatio
|
|
|
|
+
|
|
|
|
+ def updateOptimizationParameters(dictionary, star, maxTTG, ttgRatio):
|
|
|
|
+ if star not in dictionary:
|
|
|
|
+ dictionary.setdefault(star, [])
|
|
|
|
+ dictionary[star] = [ maxTTG, ttgRatio ]
|
|
|
|
+
|
|
def parseRunwayAssignment(self, icao : str, planning):
|
|
def parseRunwayAssignment(self, icao : str, planning):
|
|
|
|
+ self.OptimizationParameters = {}
|
|
self.RunwayAssignmentsShall = {}
|
|
self.RunwayAssignmentsShall = {}
|
|
self.RunwayAssignmentsShould = {}
|
|
self.RunwayAssignmentsShould = {}
|
|
self.RunwayAssignmentsMay = {}
|
|
self.RunwayAssignmentsMay = {}
|
|
@@ -242,6 +275,10 @@ class Airport:
|
|
assignments = Airport.parseAssignment(planning[key])
|
|
assignments = Airport.parseAssignment(planning[key])
|
|
Airport.updateRunwayAssignment(self.RunwayAssignmentsMay, runway, assignments)
|
|
Airport.updateRunwayAssignment(self.RunwayAssignmentsMay, runway, assignments)
|
|
mayFound = True
|
|
mayFound = True
|
|
|
|
+ elif True == key.startswith('optimization'):
|
|
|
|
+ star, maxTTG, ttgRatio = self.parseOptimization(key, planning[key])
|
|
|
|
+ Airport.updateOptimizationParameters(self.OptimizationParameters, star, maxTTG, ttgRatio)
|
|
|
|
+
|
|
|
|
|
|
# find the max delays
|
|
# find the max delays
|
|
if True == mayFound:
|
|
if True == mayFound:
|