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
    double
    Total cost of getting from start to here Mutable and changed by PathFinder
    final double
    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.
    In the graph search, what previous node contributed to the cost Mutable and changed by PathFinder
    final int
    The position of this node
    final int
     
    final int
     
  • Constructor Summary

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

    Modifier and Type
    Method
    Description
    double
    Should always be equal to estimatedCosttoGoal + cost Mutable and changed by PathFinder
    boolean
     
    int
    TODO: Possibly reimplement hashCode and equals.
    boolean
     

    Methods inherited from class Object

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

    • x

      public final int x
      The position of this node
    • y

      public final int y
    • z

      public final int z
    • estimatedCostToGoal

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

      public double 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 double combinedCost()
      Should always be equal to estimatedCosttoGoal + cost Mutable and changed by PathFinder
    • isOpen

      public boolean isOpen()
    • 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