update the fixed sequence inbound tag

This commit is contained in:
Sven Czarnian
2021-11-11 14:17:22 +01:00
parent 094e0c627a
commit f162047767

View File

@@ -31,11 +31,11 @@ class RecedingHorizonControl:
# find the correct window # find the correct window
if window.StartTime <= referenceTime and window.EndTime > referenceTime: if window.StartTime <= referenceTime and window.EndTime > referenceTime:
if i > self.FreezedIndex: self.AssignedWindow[inbound.Callsign] = [ i, 0 ]
self.AssignedWindow[inbound.Callsign] = [ i, 0 ] if False == usePTA:
if False == usePTA: inbound.PlannedArrivalTime = inbound.EarliestArrivalTime
inbound.PlannedArrivalTime = inbound.EarliestArrivalTime inbound.FixedSequence = i < self.FreezedIndex
window.insert(inbound) window.insert(inbound)
inserted = True inserted = True
break break
@@ -56,7 +56,7 @@ class RecedingHorizonControl:
window.insert(inbound) window.insert(inbound)
if False == usePTA: if False == usePTA:
inbound.PlannedArrivalTime = max(window.StartTime, inbound.EarliestArrivalTime) inbound.PlannedArrivalTime = max(window.StartTime, inbound.EarliestArrivalTime)
inbound.FixedSequence = len(self.Windows) < self.FreezedIndex
break break
lastWindowTime = self.Windows[-1].EndTime lastWindowTime = self.Windows[-1].EndTime
@@ -68,12 +68,11 @@ class RecedingHorizonControl:
index = self.AssignedWindow[inbound.Callsign][0] index = self.AssignedWindow[inbound.Callsign][0]
self.AssignedWindow[inbound.Callsign][1] = 0 self.AssignedWindow[inbound.Callsign][1] = 0
# check if we assume the scheduling as fixed
if index < self.FreezedIndex:
return
plannedInbound = self.Windows[index].inbound(inbound.Callsign) plannedInbound = self.Windows[index].inbound(inbound.Callsign)
plannedInbound.CurrentPosition = inbound.CurrentPosition plannedInbound.CurrentPosition = inbound.CurrentPosition
# ingore fixed updates
if True == plannedInbound.FixedSequence or index < self.FreezedIndex:
return
plannedInbound.ArrivalCandidates = inbound.ArrivalCandidates plannedInbound.ArrivalCandidates = inbound.ArrivalCandidates
plannedInbound.WTC = inbound.WTC plannedInbound.WTC = inbound.WTC
@@ -100,6 +99,7 @@ class RecedingHorizonControl:
self.AssignedWindow.pop(inbound.Callsign) self.AssignedWindow.pop(inbound.Callsign)
self.insertInWindow(inbound, True) self.insertInWindow(inbound, True)
else: else:
inbound.FixedSequence = index < self.FreezedIndex
self.Windows[index].Inbounds.sort(key = lambda x: x.PlannedArrivalTime) self.Windows[index].Inbounds.sort(key = lambda x: x.PlannedArrivalTime)
def lastFixedInboundOnRunway(self, runway : str): def lastFixedInboundOnRunway(self, runway : str):
@@ -165,6 +165,8 @@ class RecedingHorizonControl:
if 0 != offsetCorrection: if 0 != offsetCorrection:
for callsign in self.AssignedWindow: for callsign in self.AssignedWindow:
self.AssignedWindow[callsign][0] -= offsetCorrection self.AssignedWindow[callsign][0] -= offsetCorrection
if self.AssignedWindow[callsign][0] < self.FreezedIndex:
self.Windows[self.AssignedWindow[callsign][0]].inbound(callsign).FixedSequence = True
# delete the non-updated aircrafts and increase the missed-counter for later runs # delete the non-updated aircrafts and increase the missed-counter for later runs
callsigns = [] callsigns = []