edu.mit.ll.group43.surfaceoptimization.network.dp
Class CPSNetworkNode

java.lang.Object
  extended by edu.mit.ll.group43.surfaceoptimization.network.dp.CPSNetworkNode
All Implemented Interfaces:
NetworkNode, java.lang.Comparable<CPSNetworkNode>
Direct Known Subclasses:
SmartCPSNetworkNode

public class CPSNetworkNode
extends java.lang.Object
implements NetworkNode, java.lang.Comparable<CPSNetworkNode>

Represents a node in the CPS sequence optimization network.

Author:
William Hawkins

Constructor Summary
CPSNetworkNode(Subsequence<Aircraft> aircraft)
          Constructs a CPS network node from the given sequence of aircraft.
 
Method Summary
 void addNextNode(NetworkEdge nextNode)
          Add a relationship to the given node where this node points to it.
 void addPrevNode(NetworkEdge prevNode)
          Add a relationship to the given node where this node is pointed to by it.
 int compareTo(CPSNetworkNode other)
           
 boolean equals(java.lang.Object other)
           
 Subsequence<Aircraft> getAircraft()
          Get the subsequence of Aircraft this node represents
static int getCreated()
          Returns how many times the constructor of this class has been invoked.
 Aircraft getLastAircraft()
           
 java.util.ArrayList<NetworkEdge> getNextNodes()
          Returns a list of edges that originate from this node.
 int getOptDistance()
          Get the optimal distance this node is from the start node.
 NetworkEdge getOptPrevNode()
          Get this node's predecessor node that gives it its optimal distance from the start node.
 java.util.ArrayList<NetworkEdge> getPrevNodes()
          Returns a list of edges that point to this node.
 int hashCode()
           
 boolean isMarked()
           
 void mark()
           
 void removeNextNode(NetworkEdge nextNode)
          Remove the relationship between this node and the given node to which it points.
 void removePrevNode(NetworkEdge prevNode)
          Remove the relationship between this node and the given node that points to it.
 void removeRelationships()
          Remove relationships to this node from all nodes that point to and are pointed to by this node, then remove those relationships from this node as well.
 void setNextNodes(java.util.ArrayList<NetworkEdge> nextNodes)
          Sets this node's list of edges that originate from it.
 void setOptDistance(int optDistance)
          Set the optimal distance this node is from the start node.
 void setOptPrevNode(NetworkEdge optPrevNode)
          Set this node's predecessor node that gives it its optimal distance from the start node.
 void setPrevNodes(java.util.ArrayList<NetworkEdge> prevNodes)
          Sets this node's list of edges that point to it.
 void unmark()
           
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CPSNetworkNode

public CPSNetworkNode(Subsequence<Aircraft> aircraft)
Constructs a CPS network node from the given sequence of aircraft.

Parameters:
aircraft -
Method Detail

getCreated

public static int getCreated()
Returns how many times the constructor of this class has been invoked.

Returns:

getPrevNodes

public java.util.ArrayList<NetworkEdge> getPrevNodes()
Description copied from interface: NetworkNode
Returns a list of edges that point to this node.

Specified by:
getPrevNodes in interface NetworkNode
Returns:

setPrevNodes

public void setPrevNodes(java.util.ArrayList<NetworkEdge> prevNodes)
Description copied from interface: NetworkNode
Sets this node's list of edges that point to it.

Specified by:
setPrevNodes in interface NetworkNode

addPrevNode

public void addPrevNode(NetworkEdge prevNode)
Add a relationship to the given node where this node is pointed to by it.

Parameters:
prevNode -

removePrevNode

public void removePrevNode(NetworkEdge prevNode)
Remove the relationship between this node and the given node that points to it.

Parameters:
prevNode -

getNextNodes

public java.util.ArrayList<NetworkEdge> getNextNodes()
Description copied from interface: NetworkNode
Returns a list of edges that originate from this node.

Specified by:
getNextNodes in interface NetworkNode
Returns:

setNextNodes

public void setNextNodes(java.util.ArrayList<NetworkEdge> nextNodes)
Description copied from interface: NetworkNode
Sets this node's list of edges that originate from it.

Specified by:
setNextNodes in interface NetworkNode

addNextNode

public void addNextNode(NetworkEdge nextNode)
Add a relationship to the given node where this node points to it.

Parameters:
nextNode -

removeNextNode

public void removeNextNode(NetworkEdge nextNode)
Remove the relationship between this node and the given node to which it points.

Parameters:
nextNode -

removeRelationships

public void removeRelationships()
Remove relationships to this node from all nodes that point to and are pointed to by this node, then remove those relationships from this node as well.


getOptPrevNode

public NetworkEdge getOptPrevNode()
Get this node's predecessor node that gives it its optimal distance from the start node.

Returns:

setOptPrevNode

public void setOptPrevNode(NetworkEdge optPrevNode)
Set this node's predecessor node that gives it its optimal distance from the start node.

Parameters:
optPrevNode -

getOptDistance

public int getOptDistance()
Get the optimal distance this node is from the start node.

Returns:

setOptDistance

public void setOptDistance(int optDistance)
Set the optimal distance this node is from the start node.

Parameters:
optDistance -

getAircraft

public Subsequence<Aircraft> getAircraft()
Get the subsequence of Aircraft this node represents

Returns:

getLastAircraft

public Aircraft getLastAircraft()

mark

public void mark()

unmark

public void unmark()

isMarked

public boolean isMarked()

compareTo

public int compareTo(CPSNetworkNode other)
Specified by:
compareTo in interface java.lang.Comparable<CPSNetworkNode>

equals

public boolean equals(java.lang.Object other)
Overrides:
equals in class java.lang.Object

hashCode

public int hashCode()
Overrides:
hashCode in class java.lang.Object