Class BinaryHeapOpenSet

java.lang.Object
com.zenith.feature.pathfinder.calc.openset.BinaryHeapOpenSet
All Implemented Interfaces:
IOpenSet

public final class BinaryHeapOpenSet extends Object implements IOpenSet
A binary heap implementation of an open set. This is the one used in the AStarPathFinder.
  • Constructor Details

    • BinaryHeapOpenSet

      public BinaryHeapOpenSet()
    • BinaryHeapOpenSet

      public BinaryHeapOpenSet(int size)
  • Method Details

    • size

      public int size()
    • insert

      public void insert(PathNode value)
      Description copied from interface: IOpenSet
      Inserts the specified node into the heap
      Specified by:
      insert in interface IOpenSet
      Parameters:
      value - The node
    • update

      public void update(PathNode val)
      Description copied from interface: IOpenSet
      A faster path has been found to this node, decreasing its cost. Perform a decrease-key operation.
      Specified by:
      update in interface IOpenSet
      Parameters:
      val - The node
    • isEmpty

      public boolean isEmpty()
      Specified by:
      isEmpty in interface IOpenSet
      Returns:
      true if the heap has no elements; false otherwise.
    • removeLowest

      public PathNode removeLowest()
      Description copied from interface: IOpenSet
      Removes and returns the minimum element in the heap.
      Specified by:
      removeLowest in interface IOpenSet
      Returns:
      The minimum element in the heap