edu.mit.ll.group43.surfaceoptimization.dp.factory.cost
Class SpotCostStrategy

java.lang.Object
  extended by edu.mit.ll.group43.surfaceoptimization.dp.factory.cost.CostStrategy
      extended by edu.mit.ll.group43.surfaceoptimization.dp.factory.cost.SpotCostStrategy
Direct Known Subclasses:
OneGapSpotCostStrategy

public class SpotCostStrategy
extends CostStrategy

Cost strategy for optimizing at the spot by setting the optimal spot release times, in addition to the total distance from the start and the optimal previous node.

Author:
William Hawkins

Constructor Summary
SpotCostStrategy(int cps, MinimumSeparationCalculator<? extends WeightClass> calc)
           
 
Method Summary
 int earliestRelease(Aircraft leader, Aircraft follower)
          Returns the earliest time that the follower aircraft can leave at with the leader aircraft as its direct predecessor, while obeying all constraints.
 int earliestRelease(Aircraft leader, Aircraft follower, int predBound)
          Returns the earliest time that the follower aircraft can leave at with the leader aircraft as its direct predecessor, while obeying all constraints.
 int earliestRelease(NetworkEdge edge)
          Returns the earliest release time for the last aircraft of the target without incurring any delay at the runway, without leaving until it is ready and without leaving before the source's last aircraft has already been released.
 int getEdgeWeight(NetworkEdge edge)
          Returns the calculated edge weight, based on what has already been solved for the source node in the given network edge.
 void initializeFirstStage(java.util.ArrayList<java.util.TreeSet<CPSNetworkNode>> network)
          Initializes all nodes in the first stage of the network to have a distance of zero from the beginning, no previous node, and for their last aircraft to have an optimal spot release time equal to that of their spot ready time.
 void setOptimalValues(NetworkEdge edge, int distance)
          Sets the optimal distance from the beginning, the optimal previous node, and the optimal spot release time of the last aircraft in the target node.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SpotCostStrategy

public SpotCostStrategy(int cps,
                        MinimumSeparationCalculator<? extends WeightClass> calc)
Method Detail

initializeFirstStage

public void initializeFirstStage(java.util.ArrayList<java.util.TreeSet<CPSNetworkNode>> network)
Initializes all nodes in the first stage of the network to have a distance of zero from the beginning, no previous node, and for their last aircraft to have an optimal spot release time equal to that of their spot ready time.

Specified by:
initializeFirstStage in class CostStrategy
Parameters:
network -

setOptimalValues

public void setOptimalValues(NetworkEdge edge,
                             int distance)
Sets the optimal distance from the beginning, the optimal previous node, and the optimal spot release time of the last aircraft in the target node.

Specified by:
setOptimalValues in class CostStrategy
Parameters:
edge - Edge whose target will have its last aircraft solved for
distance - Total amount of delay incurred so far

earliestRelease

public int earliestRelease(Aircraft leader,
                           Aircraft follower)
Returns the earliest time that the follower aircraft can leave at with the leader aircraft as its direct predecessor, while obeying all constraints.

Parameters:
leader -
follower -
Returns:

earliestRelease

public int earliestRelease(Aircraft leader,
                           Aircraft follower,
                           int predBound)
Returns the earliest time that the follower aircraft can leave at with the leader aircraft as its direct predecessor, while obeying all constraints.

Parameters:
leader -
follower -
predBound - The optimal spot leave time of follower's direct predecessor in the spot release sequence.
Returns:

earliestRelease

public int earliestRelease(NetworkEdge edge)
Returns the earliest release time for the last aircraft of the target without incurring any delay at the runway, without leaving until it is ready and without leaving before the source's last aircraft has already been released.

Parameters:
edge -
Returns:

getEdgeWeight

public int getEdgeWeight(NetworkEdge edge)
Returns the calculated edge weight, based on what has already been solved for the source node in the given network edge.

Specified by:
getEdgeWeight in class CostStrategy
Parameters:
edge -
Returns: