pub trait Navigable {
    type Point;

    fn distance_score(&self, a: &Self::Point, b: &Self::Point) -> u64;
    fn get_neighbours(&self, point: &Self::Point) -> Vec<(u64, Self::Point)>;

    fn find_shortest_path(
        &self,
        start: &Self::Point,
        end: &Self::Point
    ) -> Option<Vec<Self::Point>>
    where
        Self::Point: Hash + PartialEq + Eq + Clone
, { ... } }
Expand description

This trait allows searching algorithms to navigate a space.

Required Associated Types

Describes a single point in the searchable space.

Required Methods

The distance score between points a and b.

Returns the points that can be reached directly from point, together with the distance.

Provided Methods

Use A* to find the shortest path between two points within a Navigable space.

Implementors