Struct grid_search::BfsContext
source · pub struct BfsContext { /* private fields */ }
Implementations
sourceimpl BfsContext
impl BfsContext
pub fn new(size: Size) -> Self
pub fn width(&self) -> u32
pub fn height(&self) -> u32
pub fn size(&self) -> Size
pub fn bfs_best<G, V, D, S, F>(
&mut self,
grid: &G,
start: Coord,
score: F,
directions: D,
config: SearchConfig,
max_depth: usize,
path: &mut Vec<Direction>
) -> Result<SearchMetadata<usize>, Error>where
G: SolidGrid,
V: Into<Direction>,
D: Copy + IntoIterator<Item = V>,
S: PartialOrd,
F: Fn(Coord) -> Option<S>,
pub fn bfs_predicate<G, V, D, F>(
&mut self,
grid: &G,
start: Coord,
predicate: F,
directions: D,
config: SearchConfig,
path: &mut Vec<Direction>
) -> Result<SearchMetadata<usize>, Error>where
G: SolidGrid,
V: Into<Direction>,
D: Copy + IntoIterator<Item = V>,
F: Fn(Coord) -> bool,
pub fn bfs<G, V, D>(
&mut self,
grid: &G,
start: Coord,
goal: Coord,
directions: D,
config: SearchConfig,
path: &mut Vec<Direction>
) -> Result<SearchMetadata<usize>, Error>where
G: SolidGrid,
V: Into<Direction>,
D: Copy + IntoIterator<Item = V>,
pub fn populate_distance_map<G, V, D, C>(
&mut self,
grid: &G,
start: Coord,
directions: D,
config: SearchConfig,
distance_map: &mut DistanceMap<C>
) -> Result<DistanceMapMetadata, Error>where
G: SolidGrid,
V: Into<Direction>,
D: Copy + IntoIterator<Item = V>,
C: Copy + Zero + One + Add<C>,
pub fn populate_distance_map_multi<G, V, D, C, I>(
&mut self,
grid: &G,
zero_points: I,
directions: D,
config: SearchConfig,
distance_map: &mut DistanceMap<C>
) -> Result<DistanceMapMetadata, Error>where
G: SolidGrid,
V: Into<Direction>,
D: Copy + IntoIterator<Item = V>,
C: Copy + Zero + One + Add<C>,
I: IntoIterator<Item = Coord>,
pub fn populate_uniform_distance_map<G, V, D, C>(
&mut self,
grid: &G,
start: Coord,
config: SearchConfig,
distance_map: &mut UniformDistanceMap<C, D>
) -> Result<DistanceMapMetadata, Error>where
G: SolidGrid,
V: Into<Direction>,
D: Copy + IntoIterator<Item = V>,
C: Copy + Zero + One + Add<C>,
pub fn populate_uniform_distance_map_multi<G, V, D, C, I>(
&mut self,
grid: &G,
zero_points: I,
config: SearchConfig,
distance_map: &mut UniformDistanceMap<C, D>
) -> Result<DistanceMapMetadata, Error>where
G: SolidGrid,
V: Into<Direction>,
D: Copy + IntoIterator<Item = V>,
C: Copy + Zero + One + Add<C>,
I: IntoIterator<Item = Coord>,
Trait Implementations
sourceimpl Clone for BfsContext
impl Clone for BfsContext
sourcefn clone(&self) -> BfsContext
fn clone(&self) -> BfsContext
Returns a copy of the value. Read more
1.0.0 · sourcefn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreAuto Trait Implementations
impl RefUnwindSafe for BfsContext
impl Send for BfsContext
impl Sync for BfsContext
impl Unpin for BfsContext
impl UnwindSafe for BfsContext
Blanket Implementations
sourceimpl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more