change the TTL/TTG assignment to the IAF -> predictable shortcuts via DIRECTs

This commit is contained in:
Sven Czarnian
2021-11-25 22:52:48 +01:00
parent fa0a94d733
commit a8419c286f

View File

@@ -120,26 +120,14 @@ class Colony:
# finalize the sequence # finalize the sequence
rwyManager = RunwayManager(self.Configuration) rwyManager = RunwayManager(self.Configuration)
for i in range(0, len(bestSequence[1])): for i in range(0, len(bestSequence[1])):
self.Result.append(self.Nodes[bestSequence[1][i]].Inbound) self.Result.append(self.Nodes[bestSequence[1][i]])
Colony.associateInbound(rwyManager, self.Nodes[bestSequence[1][i]], self.Configuration.EarliestArrivalTime, True) Colony.associateInbound(rwyManager, self.Nodes[bestSequence[1][i]], self.Configuration.EarliestArrivalTime, True)
# the idea behind the TTL/TTG per waypoint is that the TTL and TTG needs to be achieved in the reqTimeDelta = self.Result[-1].Inbound.InitialArrivalTime - self.Result[-1].Inbound.PlannedArrivalTime
# first 2/3 of the estimated trackmiles and assign it with a linear function to the waypoints self.Result[-1].Inbound.PlannedArrivalRoute[0].PTA = self.Result[-1].Inbound.PlannedArrivalRoute[0].ETA - reqTimeDelta
for i in range(1, len(self.Result[-1].Inbound.PlannedArrivalRoute)):
# calculate the TTL/TTG for all the waypoints (TTG is positive) prev = self.Result[-1].Inbound.PlannedArrivalRoute[i - 1]
reqTimeDelta = abs((self.Result[-1].InitialArrivalTime - self.Result[-1].PlannedArrivalTime).total_seconds()) current = self.Result[-1].Inbound.PlannedArrivalRoute[i]
gainTime = self.Result[-1].InitialArrivalTime >= self.Result[-1].PlannedArrivalTime if None == prev.ETA or None == current.ETA:
m = -3 * reqTimeDelta / (2 * self.Result[-1].PlannedTrackmiles) print(self.Result[-1].Inbound.Callsign + ': ' + prev.Waypoint.Name + ', ' + str(prev.ETA) + '; ' + current.Waypoint.Name + ', ' + current.ETA)
timeDelta = 0.0 current.PTA = prev.PTA + (current.ETA - prev.ETA)
for waypoint in self.Result[-1].PlannedArrivalRoute:
waypointDT = m * waypoint.Trackmiles + reqTimeDelta
timeDelta += waypointDT
if timeDelta > reqTimeDelta:
waypointDT -= timeDelta - reqTimeDelta
waypointDT = timedelta(seconds = (waypointDT if False == gainTime else -1.0 * waypointDT))
waypoint.PTA = waypoint.ETA + waypointDT
# reached the PTA at the waypoint
if timeDelta >= reqTimeDelta:
break