SearchContext

Struct SearchContext 

Source
pub struct SearchContext<Cost: PartialOrd<Cost>> { /* private fields */ }

Implementations§

Source§

impl<Cost: Copy + Add<Cost> + PartialOrd<Cost> + NumCast + Zero> SearchContext<Cost>

Source

pub fn astar_cardinal_manhatten_distance_heuristic<G>( &mut self, grid: &G, start: Coord, goal: Coord, config: SearchConfig, path: &mut Vec<Direction>, ) -> Result<SearchMetadata<Cost>, Error>
where G: CostGrid<Cost = Cost>,

Source§

impl<Cost> SearchContext<Cost>
where Cost: Copy + Add<Cost, Output = Cost> + Mul<Cost, Output = Cost> + PartialOrd<Cost> + NumCast + Zero,

Source

pub fn astar_diagonal_distance_heuristic<G>( &mut self, grid: &G, start: Coord, goal: Coord, weights: HeuristicDirectionWeights<Cost>, config: SearchConfig, path: &mut Vec<Direction>, ) -> Result<SearchMetadata<Cost>, Error>
where G: CostGrid<Cost = Cost>,

Source§

impl<Cost: Copy + Add<Cost> + PartialOrd<Cost> + NumCast + Zero + One> SearchContext<Cost>

Source

pub fn jump_point_search_cardinal_manhatten_distance_heuristic<G>( &mut self, grid: &G, start: Coord, goal: Coord, config: SearchConfig, path: &mut Vec<Direction>, ) -> Result<SearchMetadata<Cost>, Error>
where G: SolidGrid,

Source§

impl<Cost: Copy + Add<Cost> + PartialOrd<Cost> + Zero> SearchContext<Cost>

Source

pub fn dijkstra<G, V, D>( &mut self, grid: &G, start: Coord, goal: Coord, directions: D, config: SearchConfig, path: &mut Vec<Direction>, ) -> Result<SearchMetadata<Cost>, Error>
where G: CostGrid<Cost = Cost>, V: Into<Direction>, D: Copy + IntoIterator<Item = V>,

Source

pub fn dijkstra_predicate<G, V, D, F>( &mut self, grid: &G, start: Coord, predicate: F, directions: D, config: SearchConfig, path: &mut Vec<Direction>, ) -> Result<SearchMetadata<Cost>, Error>
where G: CostGrid<Cost = Cost>, V: Into<Direction>, D: Copy + IntoIterator<Item = V>, F: Fn(Coord) -> bool,

Source§

impl<C> SearchContext<C>
where C: Copy + Zero + One + Add<C, Output = C> + Mul<C, Output = C> + FloatConst + NumCast + PartialOrd<C>,

Source

pub fn jump_point_search_octile_distance_heuristic<G>( &mut self, grid: &G, start: Coord, goal: Coord, config: SearchConfig, path: &mut Vec<Direction>, ) -> Result<SearchMetadata<C>, Error>
where G: SolidGrid,

Source§

impl<Cost: PartialOrd<Cost> + Zero> SearchContext<Cost>

Source

pub fn new(size: Size) -> Self

Source

pub fn width(&self) -> u32

Source

pub fn height(&self) -> u32

Source

pub fn size(&self) -> Size

Source§

impl<Cost> SearchContext<Cost>
where Cost: Copy + Add + PartialOrd + Zero + One,

Source

pub fn populate_distance_map<G, V, D>( &mut self, grid: &G, start: Coord, directions: D, config: SearchConfig, distance_map: &mut DistanceMap<Cost>, ) -> Result<DistanceMapMetadata, Error>
where G: CostGrid<Cost = Cost>, V: Into<Direction>, D: Copy + IntoIterator<Item = V>,

Source§

impl<Cost> SearchContext<Cost>
where Cost: Copy + Add + PartialOrd + Zero + One + Sub<Output = Cost>,

Source

pub fn best_search_uniform_distance_map<G, V, D>( &mut self, grid: &G, start: Coord, config: SearchConfig, max_depth: Cost, distance_map: &UniformDistanceMap<Cost, D>, path: &mut Vec<Direction>, ) -> Result<SearchMetadata<Cost>, Error>
where G: SolidGrid, V: Into<Direction>, D: Copy + IntoIterator<Item = V>,

Trait Implementations§

Source§

impl<Cost: Clone + PartialOrd<Cost>> Clone for SearchContext<Cost>

Source§

fn clone(&self) -> SearchContext<Cost>

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl<Cost: Debug + PartialOrd<Cost>> Debug for SearchContext<Cost>

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

§

impl<Cost> Freeze for SearchContext<Cost>

§

impl<Cost> RefUnwindSafe for SearchContext<Cost>
where Cost: RefUnwindSafe,

§

impl<Cost> Send for SearchContext<Cost>
where Cost: Send,

§

impl<Cost> Sync for SearchContext<Cost>
where Cost: Sync,

§

impl<Cost> Unpin for SearchContext<Cost>
where Cost: Unpin,

§

impl<Cost> UnwindSafe for SearchContext<Cost>
where Cost: UnwindSafe,

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.