GridHeuristic.diagonal constructor

const GridHeuristic.diagonal(
  1. Pos goal, {
  2. double ratio,
})

Uses distanceDiagonal distance to estimate the total cost.

The ratio parameter can be used to scale the heuristic, making it more or less aggressive, where the default value is 1.0; a higher value makes the heuristic tend to overestimate the cost, which makes algorithms like A* run faster, while a lower value makes it tend to underestimate the cost which makes the algorithm run slower but may find a more optimal path.

Implementation

const factory GridHeuristic.diagonal(
  Pos goal, {
  double ratio,
}) = _DiagonalHeuristic;