Struct gardiz::graph::PathMakerBuf
source · pub struct PathMakerBuf<T>where
T: Clone + Hash + Ord + Zero + One + AddAssign + CheckedAdd + CheckedSub,{ /* private fields */ }
Expand description
A buffer for an A* search algorithm useful for saving a few deallocations
and allocations when performing lots of searches. See Graph::make_path
.
Implementations§
source§impl<T> PathMakerBuf<T>where
T: Clone + Hash + Ord + Zero + One + AddAssign + CheckedAdd + CheckedSub,
impl<T> PathMakerBuf<T>where T: Clone + Hash + Ord + Zero + One + AddAssign + CheckedAdd + CheckedSub,
sourcepub fn make_path<'graph, 'points, F>(
&mut self,
graph: &'graph mut Graph<T>,
start: &'points Vec2<T>,
goal: &'points Vec2<T>,
penalty: &'points T,
valid_points: F
) -> Option<Vec<DirecVector<T>>>where
T: Clone + Zero + One + AddAssign + AddAssign<&'points T>,
F: FnMut(&Vec2<T>) -> bool,
pub fn make_path<'graph, 'points, F>( &mut self, graph: &'graph mut Graph<T>, start: &'points Vec2<T>, goal: &'points Vec2<T>, penalty: &'points T, valid_points: F ) -> Option<Vec<DirecVector<T>>>where T: Clone + Zero + One + AddAssign + AddAssign<&'points T>, F: FnMut(&Vec2<T>) -> bool,
Performs the A* search algorithm using this buffer. See
Graph::make_path
.
Trait Implementations§
source§impl<T> Clone for PathMakerBuf<T>where
T: Clone + Hash + Ord + Zero + One + AddAssign + CheckedAdd + CheckedSub + Clone,
impl<T> Clone for PathMakerBuf<T>where T: Clone + Hash + Ord + Zero + One + AddAssign + CheckedAdd + CheckedSub + Clone,
source§fn clone(&self) -> PathMakerBuf<T>
fn clone(&self) -> PathMakerBuf<T>
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read more