Class HeuristicWeights

java.lang.Object
de.metaphoriker.pathetic.api.pathing.configuration.HeuristicWeights

public class HeuristicWeights extends Object
Represents a set of weights used to calculate a heuristic for the A* pathfinding algorithm. These weights influence the prioritization of different path characteristics during the search.

This class defines weights for the following distance metrics:

  • Manhattan Distance: Prioritizes direct movement along axes.
  • Octile Distance: Allows for diagonal movement for finer-grained pathing.
  • Perpendicular Distance: Penalizes deviation from the straight line to the target, aiding in smoother paths.
  • Height Difference: Factors in elevation changes when calculating path costs.
  • Field Details

    • NATURAL_PATH_WEIGHTS

      public static final HeuristicWeights NATURAL_PATH_WEIGHTS
      Provides a set of default heuristic weights that may be suitable for natural pathfinding. These values can be adjusted for specific scenarios.
    • DIRECT_PATH_WEIGHTS

      public static final HeuristicWeights DIRECT_PATH_WEIGHTS
      Provides a set of weights strongly prioritizing the shortest direct path, even if diagonally.
  • Constructor Details

    • HeuristicWeights

      public HeuristicWeights()