Ver código fonte

do not ignore inbounds that respawned inside the freezed time

Sven Czarnian 3 anos atrás
pai
commit
2fdb73e32e
1 arquivos alterados com 14 adições e 4 exclusões
  1. 14 4
      aman/sys/RecedingHorizonControl.py

+ 14 - 4
aman/sys/RecedingHorizonControl.py

@@ -175,13 +175,23 @@ class RecedingHorizonControl:
         return runwayInbounds, iafInbounds
 
     def optimizationRelevantInbounds(self):
-        # no new inbounds
-        if len(self.Windows) <= self.FreezedIndex + 1:
-            return None, None
-
         inbounds = []
         earliestArrivalTime = self.Windows[self.FreezedIndex + 1].StartTime
 
+        # check if we have a reconnect in the freezed blocks (VATSIM specific behavior)
+        for i in range(0, self.FreezedIndex + 1):
+            for inbound in self.Windows[i].Inbounds:
+                if False == inbound.HasValidSequence:
+                    inbounds.sort(key = lambda x: x.PlannedArrivalTime if None != x.PlannedArrivalTime else x.EnrouteArrivalTime)
+                    inbounds.append(copy.deepcopy(inbound))
+
+        # no new inbounds
+        if len(self.Windows) <= self.FreezedIndex + 1:
+            if 0 == len(inbounds):
+                return None, None
+            else:
+                return inbounds, earliestArrivalTime
+
         # check the overlapping windows
         for i in range(self.FreezedIndex + 1, len(self.Windows)):
             for inbound in self.Windows[i].Inbounds: