Skip to main content

AStarGraph

Trait AStarGraph 

Source
pub trait AStarGraph {
    type Cost: Copy + PartialOrd + Add<Output = Self::Cost>;

    // Required methods
    fn zero_cost() -> Self::Cost;
    fn max_cost() -> Self::Cost;
    fn heuristic(&self, from: NodeId, to: NodeId) -> Self::Cost;
    fn neighbors(&self, node: NodeId) -> Vec<(NodeId, Self::Cost)>;
}
Expand description

Trait implemented by any graph that wants generic A*.

Required Associated Types§

Source

type Cost: Copy + PartialOrd + Add<Output = Self::Cost>

Required Methods§

Source

fn zero_cost() -> Self::Cost

Source

fn max_cost() -> Self::Cost

Source

fn heuristic(&self, from: NodeId, to: NodeId) -> Self::Cost

Source

fn neighbors(&self, node: NodeId) -> Vec<(NodeId, Self::Cost)>

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§