edu.mit.ll.group43.surfaceoptimization.dp.factory.netgen
Class CPSNetworkGenerator

java.lang.Object
  extended by edu.mit.ll.group43.surfaceoptimization.dp.factory.netgen.CPSNetworkGenerator
Direct Known Subclasses:
GeneratorNetworkCPSNetworkGenerator, IterativeCPSNetworkGenerator

public abstract class CPSNetworkGenerator
extends java.lang.Object


Constructor Summary
CPSNetworkGenerator(int cps, CPSNetworkNodeFactory cpsNetworkNodeFactory, EdgeValueStrategy edgeValueStrategy)
           
 
Method Summary
 java.util.ArrayList<java.util.TreeSet<CPSNetworkNode>> generateCPSNetworkNodeRelationships(java.util.ArrayList<java.util.TreeSet<CPSNetworkNode>> network)
          Adds valid relationships (edges) between the nodes in the given CPS network.
abstract  java.util.ArrayList<java.util.TreeSet<CPSNetworkNode>> generateCPSNetworkNodes(java.util.ArrayList<Aircraft> fcfs)
           
 java.util.ArrayList<java.util.TreeSet<CPSNetworkNode>> generateNetwork(java.util.ArrayList<Aircraft> fcfs)
          Generates the CPS network on which the Dynamic Programming algorithm will run to find the shortest path and therefore optimal sequence.
 java.util.HashMap<java.lang.Integer,java.util.ArrayList<java.lang.Integer>> getValidLocs(int seqLength)
          Creates a HashMap of valid locations for indexes of a FCFS sequence, with respect to CPS.
 java.util.ArrayList<java.util.TreeSet<CPSNetworkNode>> markDeadEnds(java.util.ArrayList<java.util.TreeSet<CPSNetworkNode>> network)
          Marks all nodes that can't be visited from either (or both) of the starting or ending nodes.
 java.util.ArrayList<java.util.TreeSet<CPSNetworkNode>> prune(java.util.ArrayList<java.util.TreeSet<CPSNetworkNode>> network)
          Takes in a marked network and removes all nodes and associated edges that have been marked for removal.
 java.util.ArrayList<java.util.TreeSet<CPSNetworkNode>> pruneNetwork(java.util.ArrayList<java.util.TreeSet<CPSNetworkNode>> network)
          Applies marking and pruning operations to the given network, then returns it.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CPSNetworkGenerator

public CPSNetworkGenerator(int cps,
                           CPSNetworkNodeFactory cpsNetworkNodeFactory,
                           EdgeValueStrategy edgeValueStrategy)
Method Detail

generateCPSNetworkNodes

public abstract java.util.ArrayList<java.util.TreeSet<CPSNetworkNode>> generateCPSNetworkNodes(java.util.ArrayList<Aircraft> fcfs)

generateNetwork

public java.util.ArrayList<java.util.TreeSet<CPSNetworkNode>> generateNetwork(java.util.ArrayList<Aircraft> fcfs)
Generates the CPS network on which the Dynamic Programming algorithm will run to find the shortest path and therefore optimal sequence.

Parameters:
fcfs -

getValidLocs

public java.util.HashMap<java.lang.Integer,java.util.ArrayList<java.lang.Integer>> getValidLocs(int seqLength)
Creates a HashMap of valid locations for indexes of a FCFS sequence, with respect to CPS. The keys are the indexes of the new sequence, and the values are lists of indexes from the original sequence that can be placed at that position in the new sequence. Both sets of indexes are 1-based.

Parameters:
seqLength -
Returns:

generateCPSNetworkNodeRelationships

public java.util.ArrayList<java.util.TreeSet<CPSNetworkNode>> generateCPSNetworkNodeRelationships(java.util.ArrayList<java.util.TreeSet<CPSNetworkNode>> network)
Adds valid relationships (edges) between the nodes in the given CPS network.

Parameters:
network -
Returns:

markDeadEnds

public java.util.ArrayList<java.util.TreeSet<CPSNetworkNode>> markDeadEnds(java.util.ArrayList<java.util.TreeSet<CPSNetworkNode>> network)
Marks all nodes that can't be visited from either (or both) of the starting or ending nodes.

Parameters:
network -
Returns:

prune

public java.util.ArrayList<java.util.TreeSet<CPSNetworkNode>> prune(java.util.ArrayList<java.util.TreeSet<CPSNetworkNode>> network)
Takes in a marked network and removes all nodes and associated edges that have been marked for removal.

Parameters:
network -
Returns:

pruneNetwork

public java.util.ArrayList<java.util.TreeSet<CPSNetworkNode>> pruneNetwork(java.util.ArrayList<java.util.TreeSet<CPSNetworkNode>> network)
Applies marking and pruning operations to the given network, then returns it.

Parameters:
network -
Returns: