|
@@ -117,18 +117,19 @@ class RecedingHorizonControl:
|
|
|
return None, None
|
|
|
|
|
|
inbounds = []
|
|
|
- earliestArrivalTime = None
|
|
|
+ earliestArrivalTime = self.Windows[self.FreezedIndex].StartTime
|
|
|
|
|
|
# check the overlapping windows
|
|
|
- for i in range(self.FreezedIndex + 1, min(len(self.Windows), self.FreezedIndex + 1 + self.Configuration.WindowOverlap)):
|
|
|
- if None == earliestArrivalTime:
|
|
|
- earliestArrivalTime = self.Windows[i].StartTime
|
|
|
+ for i in range(self.FreezedIndex + 1, len(self.Windows)):
|
|
|
for inbound in self.Windows[i].Inbounds:
|
|
|
inbounds.append(inbound)
|
|
|
|
|
|
+ if 20 <= len(inbounds):
|
|
|
+ break
|
|
|
+
|
|
|
# check if we found relevant 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
|
|
|
else:
|
|
|
return None, None
|