Class HeuristicWeights
java.lang.Object
de.metaphoriker.pathetic.api.pathing.configuration.HeuristicWeights
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 Summary
Modifier and TypeFieldDescriptionstatic final HeuristicWeights
Provides a set of weights strongly prioritizing the shortest direct path, even if diagonally.static final HeuristicWeights
Provides a set of default heuristic weights that may be suitable for natural pathfinding. -
Method Summary
Modifier and TypeMethodDescriptionstatic HeuristicWeights
create
(double manhattanWeight, double octileWeight, double perpendicularWeight, double heightWeight) boolean
double
double
double
double
int
hashCode()
toString()
-
Field Details
-
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
Provides a set of weights strongly prioritizing the shortest direct path, even if diagonally.
-
-
Method Details
-
create
public static HeuristicWeights create(double manhattanWeight, double octileWeight, double perpendicularWeight, double heightWeight) -
getManhattanWeight
public double getManhattanWeight() -
getOctileWeight
public double getOctileWeight() -
getPerpendicularWeight
public double getPerpendicularWeight() -
getHeightWeight
public double getHeightWeight() -
equals
-
hashCode
public int hashCode() -
toString
-