pub trait InMemoryDispersalSampler<M: MathsCore, H: Habitat<M>, G: RngCore<M>>: DispersalSampler<M, H, G> + Sized {
// Required method
fn new(
dispersal: &Array2D<NonNegativeF64>,
habitat: &H
) -> Result<Self, InMemoryDispersalSamplerError>;
}
Required Methods§
sourcefn new(
dispersal: &Array2D<NonNegativeF64>,
habitat: &H
) -> Result<Self, InMemoryDispersalSamplerError>
fn new( dispersal: &Array2D<NonNegativeF64>, habitat: &H ) -> Result<Self, InMemoryDispersalSamplerError>
Creates a new in-memory dispersal sampler from the dispersal
map and
the habitat.
§Errors
Err(DispersalMapSizeMismatch)
is returned iff the dimensions of
dispersal
are not ExE
given E=WxH
where habitat has width W
and height W
.
Err(DispersalToNonHabitat)
is returned iff any dispersal targets a
non-habitat cell.
Err(DispersalFromNonHabitat)
is returned iff any non-habitat cell has
any dispersal.
Err(NoDispersalFromHabitat)
is returned iff any habitat cell does not
have any dispersal.
Object Safety§
This trait is not object safe.