Class Node

All Implemented Interfaces:
Serializable, Cloneable

public class Node extends Point
See Also:
  • Nested Class Summary

    Nested classes/interfaces inherited from class java.awt.geom.Point2D

    Point2D.Double, Point2D.Float
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    int
     
    int[][]
    DEPRECATED 2d array where each element A_ij is the distance to the j'th node on the i'th iteration of dijkstra's.
    static final int
     
    static final int
     
    int
     
    double
    nodeNumber represents the number shown on the nodule csv data to easily associate a nodule node with it's nodule number.
    int[]
     
    static final int
     
    static final int
    Node.type == 0 -> skeleton node type == 1 -> red nodule type == 2 -> green nodule type == 3 -> mixed nodule
    int
    type == 0 -> skeleton node
    type == 1 -> red nodule
    type == 2 -> green nodule
    type == 3 -> mixed nodule

    Fields inherited from class java.awt.Point

    x, y
  • Constructor Summary

    Constructors
    Constructor
    Description
    Node(int x, int y, int type, double nodeNumber)
    constructor method
    Node(int x, int y, int type, double nodeNumber, int area)
    constructor method
  • Method Summary

    Modifier and Type
    Method
    Description
    double
    distance(Node node)
    computes the euclidean distance between this node and the given node.
    boolean
    We say two nodes are equal when any of the following are true:
    1. they reference the same object in memory
    2. their x/y values are the same
    3. if they are the same type of node( skeleton/nodule) AND are within 8 pixels
    ArrayList<int[]>
    getPaths(int node)
    Finds and returns the set of paths from this node to the given node.
     
    void
    update(int type)
    method for updating the nodule.
    void
    update(int type, double nodeNumber, int area)
    method for updating the node
    void
    update(int x, int y, int type, double nodeNumber, int area)
    method for updating the node.

    Methods inherited from class java.awt.Point

    getLocation, getX, getY, move, setLocation, setLocation, setLocation, translate

    Methods inherited from class java.awt.geom.Point2D

    clone, distance, distance, distance, distanceSq, distanceSq, distanceSq, hashCode, setLocation

    Methods inherited from class java.lang.Object

    finalize, getClass, notify, notifyAll, wait, wait, wait
  • Field Details

    • SKELETON

      public static final int SKELETON
      Node.type == 0 -> skeleton node type == 1 -> red nodule type == 2 -> green nodule type == 3 -> mixed nodule
      See Also:
    • RED

      public static final int RED
      See Also:
    • GREEN

      public static final int GREEN
      See Also:
    • MIXED

      public static final int MIXED
      See Also:
    • type

      public int type
      type == 0 -> skeleton node
      type == 1 -> red nodule
      type == 2 -> green nodule
      type == 3 -> mixed nodule
    • area

      public int area
    • nodeIndex

      public int nodeIndex
    • nodeNumber

      public double nodeNumber
      nodeNumber represents the number shown on the nodule csv data to easily associate a nodule node with it's nodule number. If the node is not a nodule, the value defaults to -1. The notation is noduleNumber_noduleSubnumber, and the underscore is represented as a decimal.
    • distance

      public int[][] distance
      DEPRECATED 2d array where each element A_ij is the distance to the j'th node on the i'th iteration of dijkstra's. Each row is one iteration of Dijkstra's, we remove a used edge from the original graph and perform another iteration of dijsktra's to create a sample of possible paths. DEPRECATED
    • prevNode

      public int[] prevNode
  • Constructor Details

    • Node

      public Node(int x, int y, int type, double nodeNumber, int area)
      constructor method
      Parameters:
      x - : x coordinate of the node.
      y - : y coordinate of the node.
      type - : type of the node.
      nodeNumber - : node number of the node if it is a nodule.
      area - : nodule area of the node if it is a nodule.
    • Node

      public Node(int x, int y, int type, double nodeNumber)
      constructor method
      Parameters:
      x - : x coordinate of the node.
      y - : y coordinate of the node.
      type - : type of the node.
      nodeNumber - : node number of the node if it is a noduel.
  • Method Details

    • update

      public void update(int x, int y, int type, double nodeNumber, int area)
      method for updating the node.
      Parameters:
      x - : new x coordinate.
      y - : new y coordinate.
      type - : new type of the node.
      nodeNumber - : new node number for the node.
      area - : new nodule area for the node.
    • update

      public void update(int type, double nodeNumber, int area)
      method for updating the node
      Parameters:
      type - : new type for the node.
      nodeNumber - : new node number for the node.
      area - : new nodule area for the node.
    • update

      public void update(int type)
      method for updating the nodule.
      Parameters:
      type - : new type for the node.
    • equals

      public boolean equals(Object obj)
      We say two nodes are equal when any of the following are true:
      1. they reference the same object in memory
      2. their x/y values are the same
      3. if they are the same type of node( skeleton/nodule) AND are within 8 pixels
      Overrides:
      equals in class Point
    • getPaths

      public ArrayList<int[]> getPaths(int node)
      Finds and returns the set of paths from this node to the given node.
      Parameters:
      node - : node to search from.
      Returns:
      : the set of paths from this node to the given node.
    • distance

      public double distance(Node node)
      computes the euclidean distance between this node and the given node.
      Parameters:
      node - : node to compute the distance betwee.
      Returns:
      : the euclidean distance between this node and the given node.
    • toString

      public String toString()
      Overrides:
      toString in class Point