Browse Source

add the IAF spacing constraint to the arrival estimation

Sven Czarnian 3 years ago
parent
commit
97c7173313
1 changed files with 35 additions and 0 deletions
  1. 35 0
      aman/sys/aco/RunwayManager.py

+ 35 - 0
aman/sys/aco/RunwayManager.py

@@ -141,6 +141,41 @@ class RunwayManager:
                 lostTime = delta
                 eta = candidate
 
+        # find the corresponding IAF
+        iaf = node.ArrivalCandidates[selectedRunway.Name].ArrivalRoute[0].Waypoint.Name
+        if iaf in self.IafInbounds:
+            delta = 100000.0
+            targetLevel = None
+
+            # find the planned level
+            for level in self.IafInbounds[iaf]:
+                difference = abs(level - node.ArrivalCandidates[selectedRunway.Name].ArrivalRoute[0].Altitude)
+                if difference < delta:
+                    delta = difference
+                    targetLevel = level
+
+            if targetLevel in self.IafInbounds[iaf]:
+                # check if we have to lose time to ensure the IAF spacing
+                # the function assumes that model allows only TTG during flight to IAF
+                if None != self.IafInbounds[iaf][targetLevel]:
+                    if None != self.IafInbounds[iaf][targetLevel].Inbound.PlannedArrivalRoute:
+                        # ETA at IAF of preceeding traffic
+                        plannedDelta = self.IafInbounds[iaf][targetLevel].Inbound.PlannedArrivalTime - self.IafInbounds[iaf][targetLevel].Inbound.EnrouteArrivalTime
+                        iafETAPreceeding = self.IafInbounds[iaf][targetLevel].Inbound.PlannedArrivalRoute[0].ETA + plannedDelta
+
+                        # ETA at IAF of current inbound
+                        plannedDelta = eta - node.Inbound.EnrouteArrivalTime
+                        iafETACurrent = node.ArrivalCandidates[selectedRunway.Name].ArrivalRoute[0].ETA
+
+                        # required time delte to ensure IAF spacing
+                        timeSpacing = timedelta(hours = self.Configuration.AirportConfiguration.IafSpacing / node.ArrivalCandidates[selectedRunway.Name].ArrivalRoute[0].GroundSpeed)
+
+                        # we are too close to preceeding traffic
+                        currentTimeSpacing = iafETACurrent - iafETAPreceeding
+                        if timeSpacing > currentTimeSpacing:
+                            eta = eta + (timeSpacing - currentTimeSpacing)
+                            lostTime += (timeSpacing - currentTimeSpacing)
+
         return selectedRunway, eta, lostTime
 
     def registerNode(self, node : Node, runway : str):