Sven Czarnian 3 роки тому
батько
коміт
4f21f8968b
1 змінених файлів з 6 додано та 8 видалено
  1. 6 8
      aman/sys/aco/Node.py

+ 6 - 8
aman/sys/aco/Node.py

@@ -196,15 +196,13 @@ class Node:
                 decreasedSpeedFlighttime = (trackmiles / avgSpeedDecrease) * 3600.0 # given in seconds
 
                 # calculate shortcut gain and add 15 miles for final and base turn
-                currentPosition = Waypoint(latitude = self.PredictedCoordinate[0], longitude = self.PredictedCoordinate[1])
-                shortcutDistance = currentPosition.haversine(identifier.Runway.Start) + 25.0
-                shortcutFlighttime = (shortcutDistance / avgSpeed) * 3600.0
-                if shortcutFlighttime > flightTime.total_seconds():
-                    shortcutFlighttime = flightTime.total_seconds()
-
-                # the best TTG is the shortest path with the fastest speed
-                ttg = timedelta(seconds = flightTime.total_seconds() - shortcutFlighttime)
+                timeUntilIAF = flightTime - flightTimeOnStar
+                if 0.0 > timeUntilIAF.total_seconds():
+                    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)
                 ttl = timedelta(seconds = decreasedSpeedFlighttime - flightTime.total_seconds())
                 ita = self.Inbound.ReportTime + flightTime
                 earliest = ita - ttg