handle the requested runways in the optimization
This commit is contained in:
@@ -72,6 +72,7 @@ class RecedingHorizonControl:
|
|||||||
plannedInbound.Report = inbound.Report
|
plannedInbound.Report = inbound.Report
|
||||||
plannedInbound.ReportTime = inbound.ReportTime
|
plannedInbound.ReportTime = inbound.ReportTime
|
||||||
plannedInbound.CurrentPosition = inbound.CurrentPosition
|
plannedInbound.CurrentPosition = inbound.CurrentPosition
|
||||||
|
plannedInbound.RequestedRunway = inbound.RequestedRunway
|
||||||
# ingore fixed updates
|
# ingore fixed updates
|
||||||
if True == plannedInbound.FixedSequence or index <= self.FreezedIndex:
|
if True == plannedInbound.FixedSequence or index <= self.FreezedIndex:
|
||||||
plannedInbound.FixedSequence = True
|
plannedInbound.FixedSequence = True
|
||||||
|
|||||||
@@ -118,10 +118,13 @@ class RunwayManager:
|
|||||||
def selectArrivalRunway(self, node : Node, earliestArrivalTime : datetime):
|
def selectArrivalRunway(self, node : Node, earliestArrivalTime : datetime):
|
||||||
availableRunways = self.Configuration.RunwayConstraints.ActiveArrivalRunways
|
availableRunways = self.Configuration.RunwayConstraints.ActiveArrivalRunways
|
||||||
|
|
||||||
if True == self.Configuration.RunwayConstraints.UseShallShouldMay:
|
if True == self.Configuration.RunwayConstraints.UseShallShouldMay and None == node.Inbound.RequestedRunway:
|
||||||
availableRunways = self.executeShallShouldMayAssignment(node, earliestArrivalTime)
|
availableRunways = self.executeShallShouldMayAssignment(node, earliestArrivalTime)
|
||||||
else:
|
elif None != node.Inbound.RequestedRunway:
|
||||||
availableRunways = self.Configuration.RunwayConstraints.ActiveArrivalRunways
|
for runway in availableRunways:
|
||||||
|
if node.Inbound.RequestedRunway == runway.Runway.Name:
|
||||||
|
availableRunways = [ runway ]
|
||||||
|
break
|
||||||
|
|
||||||
if 0 == len(availableRunways):
|
if 0 == len(availableRunways):
|
||||||
runway = self.Configuration.RunwayConstraints.ActiveArrivalRunways[0]
|
runway = self.Configuration.RunwayConstraints.ActiveArrivalRunways[0]
|
||||||
|
|||||||
@@ -15,6 +15,7 @@ class Inbound:
|
|||||||
self.CurrentPosition = report.position
|
self.CurrentPosition = report.position
|
||||||
self.ReportTime = datetime.strptime(report.reportTime + '+0000', '%Y%m%d%H%M%S%z').replace(tzinfo = pytz.UTC)
|
self.ReportTime = datetime.strptime(report.reportTime + '+0000', '%Y%m%d%H%M%S%z').replace(tzinfo = pytz.UTC)
|
||||||
self.InitialArrivalTime = None
|
self.InitialArrivalTime = None
|
||||||
|
self.RequestedRunway = None
|
||||||
self.PlannedArrivalTime = None
|
self.PlannedArrivalTime = None
|
||||||
self.PlannedRunway = None
|
self.PlannedRunway = None
|
||||||
self.PlannedStar = None
|
self.PlannedStar = None
|
||||||
@@ -28,6 +29,10 @@ class Inbound:
|
|||||||
if 'L' == wtc or 'M' == wtc or 'H' == wtc or 'J' == wtc:
|
if 'L' == wtc or 'M' == wtc or 'H' == wtc or 'J' == wtc:
|
||||||
self.WTC = wtc
|
self.WTC = wtc
|
||||||
|
|
||||||
|
# analyze the requested runway
|
||||||
|
if '' != report.requestedRunway:
|
||||||
|
self.RequestedRunway = report.requestedRunway
|
||||||
|
|
||||||
# search performance data -> fallback to A320
|
# search performance data -> fallback to A320
|
||||||
if self.Report.aircraft.type in performanceData.Aircrafts:
|
if self.Report.aircraft.type in performanceData.Aircrafts:
|
||||||
self.PerformanceData = performanceData.Aircrafts[self.Report.aircraft.type]
|
self.PerformanceData = performanceData.Aircrafts[self.Report.aircraft.type]
|
||||||
|
|||||||
Reference in New Issue
Block a user