pub struct MooreNeighborhood { /* private fields */ }Expand description
A Neighborhood for Agents moving along the 4 cardinal directions and the 4 diagonals.
Also known as Moore Neighborhood, Maximum Metric or Chebyshev Metric.
A: Agent, o: reachable in one step
o o o
\|/
o-A-o
/|\
o o oImplementations§
Source§impl MooreNeighborhood
impl MooreNeighborhood
Sourcepub fn new(width: usize, height: usize) -> MooreNeighborhood
pub fn new(width: usize, height: usize) -> MooreNeighborhood
Creates a new MooreNeighborhood.
width and height are the size of the Grid to move on.
Trait Implementations§
Source§impl Clone for MooreNeighborhood
impl Clone for MooreNeighborhood
Source§fn clone(&self) -> MooreNeighborhood
fn clone(&self) -> MooreNeighborhood
Returns a duplicate 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 moreSource§impl Debug for MooreNeighborhood
impl Debug for MooreNeighborhood
Source§impl Neighborhood for MooreNeighborhood
impl Neighborhood for MooreNeighborhood
impl Copy for MooreNeighborhood
Auto Trait Implementations§
impl Freeze for MooreNeighborhood
impl RefUnwindSafe for MooreNeighborhood
impl Send for MooreNeighborhood
impl Sync for MooreNeighborhood
impl Unpin for MooreNeighborhood
impl UnwindSafe for MooreNeighborhood
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more