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