Class AbsoluteHeuristic

  • All Implemented Interfaces:
    Heuristic

    public class AbsoluteHeuristic
    extends java.lang.Object
    implements Heuristic
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      float getCost​(int x, int y, int z, int tx, int ty, int tz)
      Get the additional heuristic cost of the given tile.
      • Methods inherited from class java.lang.Object

        equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • AbsoluteHeuristic

        public AbsoluteHeuristic()
    • Method Detail

      • getCost

        public float getCost​(int x,
                             int y,
                             int z,
                             int tx,
                             int ty,
                             int tz)
        Get the additional heuristic cost of the given tile. This controls the order in which tiles are searched while attempting to find a path to the target location. The lower the cost the more likely the tile will be searched.
        Specified by:
        getCost in interface Heuristic
        Parameters:
        x - The x coordinate of the tile being evaluated
        y - The y coordinate of the tile being evaluated
        z - The z coordinate of the tile being evaluated
        tx - The x coordinate of the destination location
        ty - The y coordinate of the destination location
        tz - The z coordinate of the destination location
        Returns:
        The cost associated with the given tile