use as much aircrafts as possible

This commit is contained in:
Sven Czarnian
2021-11-29 17:13:28 +01:00
parent 8277721edb
commit 836ff0a8b2

View File

@@ -117,18 +117,19 @@ class RecedingHorizonControl:
return None, None return None, None
inbounds = [] inbounds = []
earliestArrivalTime = None earliestArrivalTime = self.Windows[self.FreezedIndex].StartTime
# check the overlapping windows # check the overlapping windows
for i in range(self.FreezedIndex + 1, min(len(self.Windows), self.FreezedIndex + 1 + self.Configuration.WindowOverlap)): for i in range(self.FreezedIndex + 1, len(self.Windows)):
if None == earliestArrivalTime:
earliestArrivalTime = self.Windows[i].StartTime
for inbound in self.Windows[i].Inbounds: for inbound in self.Windows[i].Inbounds:
inbounds.append(inbound) inbounds.append(inbound)
if 20 <= len(inbounds):
break
# check if we found relevant inbounds # check if we found relevant inbounds
if 0 != len(inbounds): if 0 != len(inbounds):
inbounds.sort(key = lambda x: x.InitialArrivalTime) inbounds.sort(key = lambda x: x.PlannedArrivalTime if None != x.PlannedArrivalTime else x.InitialArrivalTime)
return inbounds, earliestArrivalTime return inbounds, earliestArrivalTime
else: else:
return None, None return None, None