|
@@ -68,23 +68,28 @@ class RunwayManager:
|
|
|
shallRunways = []
|
|
|
shouldRunways = []
|
|
|
mayRunways = []
|
|
|
+ expectedRunway = None
|
|
|
|
|
|
for runway in self.Configuration.RunwayConstraints.ActiveArrivalRunways:
|
|
|
# test the shall assignments
|
|
|
if RunwayAssignmentType.AircraftType in runway.ShallAssignments:
|
|
|
if node.Inbound.Report.aircraft.type in runway.ShallAssignments[RunwayAssignmentType.AircraftType]:
|
|
|
shallRunways.append(runway)
|
|
|
+ expectedRunway = runway.Runway.Name
|
|
|
if RunwayAssignmentType.GateAssignment in runway.ShallAssignments:
|
|
|
if node.Inbound.Report.plannedGate in runway.ShallAssignments[RunwayAssignmentType.GateAssignment]:
|
|
|
shallRunways.append(runway)
|
|
|
+ expectedRunway = runway.Runway.Name
|
|
|
|
|
|
# test the should assignments
|
|
|
if RunwayAssignmentType.AircraftType in runway.ShouldAssignments:
|
|
|
if node.Inbound.Report.aircraft.type in runway.ShouldAssignments[RunwayAssignmentType.AircraftType]:
|
|
|
shouldRunways.append(runway)
|
|
|
+ expectedRunway = runway.Runway.Name
|
|
|
if RunwayAssignmentType.GateAssignment in runway.ShouldAssignments:
|
|
|
if node.Inbound.Report.plannedGate in runway.ShouldAssignments[RunwayAssignmentType.GateAssignment]:
|
|
|
shouldRunways.append(runway)
|
|
|
+ expectedRunway = runway.Runway.Name
|
|
|
|
|
|
# test the may assignments
|
|
|
if RunwayAssignmentType.AircraftType in runway.MayAssignments:
|
|
@@ -92,41 +97,46 @@ class RunwayManager:
|
|
|
eta, _ = self.calculateEarliestArrivalTime(runway.Runway.Name, node, earliestArrivalTime)
|
|
|
if (eta - node.ArrivalCandidates[runway.Runway.Name].InitialArrivalTime) <= self.Configuration.AirportConfiguration.MaxDelayMay:
|
|
|
mayRunways.append(runway)
|
|
|
+ expectedRunway = runway.Runway.Name
|
|
|
if RunwayAssignmentType.GateAssignment in runway.MayAssignments:
|
|
|
if node.Inbound.Report.plannedGate in runway.MayAssignments[RunwayAssignmentType.GateAssignment]:
|
|
|
eta, _ = self.calculateEarliestArrivalTime(runway.Runway.Name, node, earliestArrivalTime)
|
|
|
if (eta - node.ArrivalCandidates[runway.Runway.Name].InitialArrivalTime) <= self.Configuration.AirportConfiguration.MaxDelayMay:
|
|
|
mayRunways.append(runway)
|
|
|
+ expectedRunway = runway.Runway.Name
|
|
|
|
|
|
runway = self.selectShallShouldMayArrivalRunway(node, shallRunways, earliestArrivalTime)
|
|
|
if None != runway:
|
|
|
- return [ runway ]
|
|
|
+ return 'shall', expectedRunway, [ runway ]
|
|
|
runway = self.selectShallShouldMayArrivalRunway(node, shouldRunways, earliestArrivalTime)
|
|
|
if None != runway:
|
|
|
- return [ runway ]
|
|
|
+ return 'should', expectedRunway, [ runway ]
|
|
|
runway = self.selectShallShouldMayArrivalRunway(node, mayRunways, earliestArrivalTime)
|
|
|
if None != runway:
|
|
|
- return [ runway ]
|
|
|
+ return 'may', expectedRunway, [ runway ]
|
|
|
|
|
|
- return self.Configuration.RunwayConstraints.ActiveArrivalRunways
|
|
|
+ return 'other', None, self.Configuration.RunwayConstraints.ActiveArrivalRunways
|
|
|
|
|
|
def selectArrivalRunway(self, node : Node, earliestArrivalTime : datetime):
|
|
|
availableRunways = self.Configuration.RunwayConstraints.ActiveArrivalRunways
|
|
|
if 0 == len(availableRunways):
|
|
|
- return None, None, None
|
|
|
+ return None, None, None, None, None
|
|
|
+
|
|
|
+ expectedRunway = None
|
|
|
|
|
|
if True == self.Configuration.RunwayConstraints.UseShallShouldMay and None == node.Inbound.RequestedRunway:
|
|
|
- availableRunways = self.executeShallShouldMayAssignment(node, earliestArrivalTime)
|
|
|
+ type, expectedRunway, availableRunways = self.executeShallShouldMayAssignment(node, earliestArrivalTime)
|
|
|
elif None != node.Inbound.RequestedRunway:
|
|
|
for runway in availableRunways:
|
|
|
if node.Inbound.RequestedRunway == runway.Runway.Name:
|
|
|
availableRunways = [ runway ]
|
|
|
+ type = 'other'
|
|
|
break
|
|
|
|
|
|
if 0 == len(availableRunways):
|
|
|
runway = self.Configuration.RunwayConstraints.ActiveArrivalRunways[0]
|
|
|
eta, delta = self.calculateEarliestArrivalTime(runway.Runway.Name, node, earliestArrivalTime)
|
|
|
- return runway, eta, delta
|
|
|
+ return 'other', None, runway, eta, delta
|
|
|
|
|
|
# start with the beginning
|
|
|
selectedRunway = None
|
|
@@ -176,7 +186,7 @@ class RunwayManager:
|
|
|
eta = eta + (timeSpacing - currentTimeSpacing)
|
|
|
lostTime += (timeSpacing - currentTimeSpacing)
|
|
|
|
|
|
- return selectedRunway, eta, lostTime
|
|
|
+ return type, expectedRunway, selectedRunway, eta, lostTime
|
|
|
|
|
|
def registerNode(self, node : Node, runway : str):
|
|
|
self.RunwayInbounds[runway] = node
|