Class PathNode

java.lang.Object
com.zenith.feature.pathfinder.calc.PathNode

public final class PathNode extends Object
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    float
    Total cost of getting from start to here Mutable and changed by PathFinder
    final float
    Cached, should always be equal to goal.heuristic(pos)
    int
    Where is this node in the array flattenization of the binary heap? Needed for decrease-key operations.
    long
    The position of this node
    In the graph search, what previous node contributed to the cost Mutable and changed by PathFinder
  • Constructor Summary

    Constructors
    Constructor
    Description
    PathNode(int x, int y, int z, Goal goal)
     
  • Method Summary

    Modifier and Type
    Method
    Description
    float
    Should always be equal to estimatedCosttoGoal + cost Mutable and changed by PathFinder
    boolean
     
    int
    TODO: Possibly reimplement hashCode and equals.
    boolean
     
    int
    x()
     
    int
    y()
     
    int
    z()
     

    Methods inherited from class Object

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

    • pos

      public long pos
      The position of this node
    • estimatedCostToGoal

      public final float estimatedCostToGoal
      Cached, should always be equal to goal.heuristic(pos)
    • cost

      public float cost
      Total cost of getting from start to here Mutable and changed by PathFinder
    • previous

      public PathNode previous
      In the graph search, what previous node contributed to the cost Mutable and changed by PathFinder
    • heapPosition

      public int heapPosition
      Where is this node in the array flattenization of the binary heap? Needed for decrease-key operations.
  • Constructor Details

    • PathNode

      public PathNode(int x, int y, int z, Goal goal)
  • Method Details

    • combinedCost

      public float combinedCost()
      Should always be equal to estimatedCosttoGoal + cost Mutable and changed by PathFinder
    • isOpen

      public boolean isOpen()
    • x

      public int x()
    • y

      public int y()
    • z

      public int z()
    • hashCode

      public int hashCode()
      TODO: Possibly reimplement hashCode and equals. They are necessary for this class to function but they could be done better
      Overrides:
      hashCode in class Object
      Returns:
      The hash code value for this PathNode
    • equals

      public boolean equals(Object obj)
      Overrides:
      equals in class Object