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§

source

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.

Implementors§

source§

impl<M: MathsCore, H: Habitat<M>, G: RngCore<M>> InMemoryDispersalSampler<M, H, G> for InMemoryAliasDispersalSampler<M, H, G>

source§

impl<M: MathsCore, H: Habitat<M>, G: RngCore<M>> InMemoryDispersalSampler<M, H, G> for InMemoryCumulativeDispersalSampler<M, H, G>

source§

impl<M: MathsCore, H: Habitat<M>, G: RngCore<M>> InMemoryDispersalSampler<M, H, G> for InMemoryPackedAliasDispersalSampler<M, H, G>

source§

impl<M: MathsCore, H: Habitat<M>, G: RngCore<M>> InMemoryDispersalSampler<M, H, G> for InMemoryPackedSeparableAliasDispersalSampler<M, H, G>

source§

impl<M: MathsCore, H: Habitat<M>, G: RngCore<M>> InMemoryDispersalSampler<M, H, G> for InMemorySeparableAliasDispersalSampler<M, H, G>