diff --git a/aman/sys/RecedingHorizonControl.py b/aman/sys/RecedingHorizonControl.py index 54d590e..d1f98b7 100644 --- a/aman/sys/RecedingHorizonControl.py +++ b/aman/sys/RecedingHorizonControl.py @@ -21,7 +21,7 @@ class RecedingHorizonControl: def insertInWindow(self, inbound : Inbound, usePTA : bool): if False == usePTA: - referenceTime = inbound.InitialArrivalTime + referenceTime = inbound.EnrouteArrivalTime else: referenceTime = inbound.PlannedArrivalTime @@ -34,7 +34,7 @@ class RecedingHorizonControl: self.AssignedWindow[inbound.Callsign] = [ i, 0 ] inbound.FixedSequence = i < self.FreezedIndex if True == inbound.FixedSequence and None == inbound.PlannedArrivalTime: - inbound.PlannedArrivalTime = inbound.InitialArrivalTime + inbound.PlannedArrivalTime = inbound.EnrouteArrivalTime window.insert(inbound) inserted = True break @@ -56,11 +56,11 @@ class RecedingHorizonControl: self.AssignedWindow[inbound.Callsign] = [ len(self.Windows) - 1, 0 ] inbound.FixedSequence = len(self.Windows) < self.FreezedIndex if True == inbound.FixedSequence and None == inbound.PlannedArrivalTime: - inbound.PlannedArrivalTime = inbound.InitialArrivalTime + inbound.PlannedArrivalTime = inbound.EnrouteArrivalTime break lastWindowTime = self.Windows[-1].EndTime - window.Inbounds.sort(key = lambda x: x.PlannedArrivalTime if None != x.PlannedArrivalTime else x.InitialArrivalTime) + window.Inbounds.sort(key = lambda x: x.PlannedArrivalTime if None != x.PlannedArrivalTime else x.EnrouteArrivalTime) def updateReport(self, inbound : Inbound): # check if we need to update @@ -81,18 +81,18 @@ class RecedingHorizonControl: # check if we need to update the inbound if None == plannedInbound.PlannedStar: - reference = inbound.InitialArrivalTime - if plannedInbound.InitialArrivalTime > reference: - reference = plannedInbound.InitialArrivalTime + reference = inbound.EnrouteArrivalTime + if plannedInbound.EnrouteArrivalTime > reference: + reference = plannedInbound.EnrouteArrivalTime if reference < self.Windows[index].StartTime or reference >= self.Windows[index].EndTime: self.Windows[index].remove(inbound.Callsign) self.AssignedWindow.pop(inbound.Callsign) - inbound.InitialArrivalTime = reference + inbound.EnrouteArrivalTime = reference self.updateReport(inbound) else: - plannedInbound.InitialArrivalTime = reference - self.Windows[index].Inbounds.sort(key = lambda x: x.PlannedArrivalTime if None != x.PlannedArrivalTime else x.InitialArrivalTime) + plannedInbound.EnrouteArrivalTime = reference + self.Windows[index].Inbounds.sort(key = lambda x: x.PlannedArrivalTime if None != x.PlannedArrivalTime else x.EnrouteArrivalTime) else: self.insertInWindow(inbound, False) @@ -104,7 +104,7 @@ class RecedingHorizonControl: self.insertInWindow(inbound, True) else: inbound.FixedSequence = index < self.FreezedIndex - self.Windows[index].Inbounds.sort(key = lambda x: x.PlannedArrivalTime if None != x.PlannedArrivalTime else x.InitialArrivalTime) + self.Windows[index].Inbounds.sort(key = lambda x: x.PlannedArrivalTime if None != x.PlannedArrivalTime else x.EnrouteArrivalTime) def lastFixedInboundOnRunway(self, runway : str): # no inbounds available @@ -138,7 +138,7 @@ class RecedingHorizonControl: # check if we found relevant inbounds if 0 != len(inbounds): - inbounds.sort(key = lambda x: x.PlannedArrivalTime if None != x.PlannedArrivalTime else x.InitialArrivalTime) + inbounds.sort(key = lambda x: x.PlannedArrivalTime if None != x.PlannedArrivalTime else x.EnrouteArrivalTime) return inbounds, earliestArrivalTime else: return None, None diff --git a/aman/sys/Worker.py b/aman/sys/Worker.py index b16d6f4..d568d70 100644 --- a/aman/sys/Worker.py +++ b/aman/sys/Worker.py @@ -88,7 +88,7 @@ class Worker(Thread): if '' != report.initialApproachFix: inbound = Inbound(report, self.PerformanceData) Node(inbound, inbound.ReportTime, self.WeatherModel, self.Configuration, self.SequencingConfiguration) - if None != inbound.InitialArrivalTime: + if None != inbound.EnrouteArrivalTime: self.RecedingHorizonControl.updateReport(inbound) else: print('Unable to find all data of ' + report.aircraft.callsign) diff --git a/aman/sys/aco/Colony.py b/aman/sys/aco/Colony.py index 5502a4e..bcadac7 100644 --- a/aman/sys/aco/Colony.py +++ b/aman/sys/aco/Colony.py @@ -74,7 +74,7 @@ class Colony: self.Result.append(node) Colony.associateInbound(rwyManager, node, self.Configuration.EarliestArrivalTime) - reqTimeDelta = self.Result[-1].Inbound.InitialArrivalTime - self.Result[-1].Inbound.PlannedArrivalTime + reqTimeDelta = self.Result[-1].Inbound.EnrouteArrivalTime - self.Result[-1].Inbound.PlannedArrivalTime 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)): prev = self.Result[-1].Inbound.PlannedArrivalRoute[i - 1] diff --git a/aman/sys/aco/Node.py b/aman/sys/aco/Node.py index 49ffbb2..ed2af92 100644 --- a/aman/sys/aco/Node.py +++ b/aman/sys/aco/Node.py @@ -184,7 +184,7 @@ class Node: self.PredictedCoordinate = prediction - setInitialArrivalTime = None == self.Inbound.InitialArrivalTime + setEnrouteTime = None == self.Inbound.EnrouteArrivalTime # calculate the timings for the different arrival runways for identifier in sequencingConfig.ActiveArrivalRunways: @@ -214,6 +214,5 @@ class Node: self.ArrivalCandidates[identifier.Runway.Name] = ArrivalData(star = star, ita = earliest, route = arrivalRoute, trackmiles = trackmiles) - ita = self.ArrivalCandidates[identifier.Runway.Name].InitialArrivalTime - if True == setInitialArrivalTime and (None == self.Inbound.InitialArrivalTime or ita < self.Inbound.InitialArrivalTime): - self.Inbound.InitialArrivalTime = ita + if True == setEnrouteTime and (None == self.Inbound.EnrouteArrivalTime or ita < self.Inbound.EnrouteArrivalTime): + self.Inbound.EnrouteArrivalTime = ita diff --git a/aman/types/Inbound.py b/aman/types/Inbound.py index 6e8e355..8c1565a 100644 --- a/aman/types/Inbound.py +++ b/aman/types/Inbound.py @@ -14,7 +14,7 @@ class Inbound: self.Callsign = report.aircraft.callsign self.CurrentPosition = report.position self.ReportTime = datetime.strptime(report.reportTime + '+0000', '%Y%m%d%H%M%S%z').replace(tzinfo = pytz.UTC) - self.InitialArrivalTime = None + self.EnrouteArrivalTime = None self.RequestedRunway = None self.PlannedArrivalTime = None self.PlannedRunway = None