pub trait CostMetric: Debug {
// Required method
fn delta_cost(
&self,
from: (usize, usize),
to: (usize, usize),
periodic: bool,
width: usize,
height: usize,
diagonal: bool,
) -> f64;
}Expand description
Trait for cost metrics used in A* pathfinding on 2D grids.
Implementing this trait allows custom cost metrics to be plugged into the grid A* algorithm.