Trait rustcoalescence_scenarios::Scenario

source ·
pub trait Scenario<M: MathsCore, G: RngCore<M>>: Sized + Send + ScenarioParameters {
    type Habitat: Send + Clone + UniformlySampleableHabitat<M, G>;
    type OriginSampler<'h, I: Iterator<Item = u64>>: TrustedOriginSampler<'h, M, Habitat = Self::Habitat>
       where M: 'h,
             G: 'h,
             Self: 'h;
    type OriginSamplerAuxiliary: Send + Clone;
    type Decomposition: Decomposition<M, Self::Habitat>;
    type DecompositionAuxiliary: Send + Clone;
    type LineageStore<L: LineageStore<M, Self::Habitat>>: LineageStore<M, Self::Habitat>;
    type DispersalSampler: Send + Clone + DispersalSampler<M, Self::Habitat, G>;
    type TurnoverRate: Send + Clone + TurnoverRate<M, Self::Habitat>;
    type SpeciationProbability: Send + Clone + SpeciationProbability<M, Self::Habitat>;

    // Required methods
    fn new(
        args: Self::Arguments,
        speciation_probability_per_generation: PositiveUnitF64
    ) -> Result<ScenarioCogs<M, G, Self>, Self::Error>;
    fn sample_habitat<'h, I: Iterator<Item = u64>>(
        habitat: &'h Self::Habitat,
        pre_sampler: OriginPreSampler<M, I>,
        auxiliary: Self::OriginSamplerAuxiliary
    ) -> Self::OriginSampler<'h, I>
       where G: 'h;
    fn decompose(
        habitat: &Self::Habitat,
        subdomain: Partition,
        auxiliary: Self::DecompositionAuxiliary
    ) -> Self::Decomposition;
}

Required Associated Types§

source

type Habitat: Send + Clone + UniformlySampleableHabitat<M, G>

source

type OriginSampler<'h, I: Iterator<Item = u64>>: TrustedOriginSampler<'h, M, Habitat = Self::Habitat> where M: 'h, G: 'h, Self: 'h

source

type OriginSamplerAuxiliary: Send + Clone

source

type Decomposition: Decomposition<M, Self::Habitat>

source

type DecompositionAuxiliary: Send + Clone

source

type LineageStore<L: LineageStore<M, Self::Habitat>>: LineageStore<M, Self::Habitat>

source

type DispersalSampler: Send + Clone + DispersalSampler<M, Self::Habitat, G>

source

type TurnoverRate: Send + Clone + TurnoverRate<M, Self::Habitat>

source

type SpeciationProbability: Send + Clone + SpeciationProbability<M, Self::Habitat>

Required Methods§

source

fn new( args: Self::Arguments, speciation_probability_per_generation: PositiveUnitF64 ) -> Result<ScenarioCogs<M, G, Self>, Self::Error>

§Errors

Returns a Self::Error if creating the scenario failed

source

fn sample_habitat<'h, I: Iterator<Item = u64>>( habitat: &'h Self::Habitat, pre_sampler: OriginPreSampler<M, I>, auxiliary: Self::OriginSamplerAuxiliary ) -> Self::OriginSampler<'h, I>
where G: 'h,

source

fn decompose( habitat: &Self::Habitat, subdomain: Partition, auxiliary: Self::DecompositionAuxiliary ) -> Self::Decomposition

Object Safety§

This trait is not object safe.

Implementors§

source§

impl<M: MathsCore, G: RngCore<M>> Scenario<M, G> for AlmostInfiniteClark2DtDispersalScenario

§

type Decomposition = RadialDecomposition

§

type DecompositionAuxiliary = ()

§

type DispersalSampler = AlmostInfiniteClark2DtDispersalSampler<M, G>

§

type Habitat = AlmostInfiniteHabitat<M>

§

type LineageStore<L: LineageStore<M, Self::Habitat>> = SingletonDemesLineageStore<M, <AlmostInfiniteClark2DtDispersalScenario as Scenario<M, G>>::Habitat>

§

type OriginSampler<'h, I: Iterator<Item = u64>> = SingletonDemesOriginSampler<'h, M, <AlmostInfiniteClark2DtDispersalScenario as Scenario<M, G>>::Habitat, I> where G: 'h

§

type OriginSamplerAuxiliary = (Sample,)

§

type SpeciationProbability = UniformSpeciationProbability

§

type TurnoverRate = UniformTurnoverRate

source§

impl<M: MathsCore, G: RngCore<M>> Scenario<M, G> for AlmostInfiniteNormalDispersalScenario

§

type Decomposition = RadialDecomposition

§

type DecompositionAuxiliary = ()

§

type DispersalSampler = AlmostInfiniteNormalDispersalSampler<M, G>

§

type Habitat = AlmostInfiniteHabitat<M>

§

type LineageStore<L: LineageStore<M, Self::Habitat>> = SingletonDemesLineageStore<M, <AlmostInfiniteNormalDispersalScenario as Scenario<M, G>>::Habitat>

§

type OriginSampler<'h, I: Iterator<Item = u64>> = SingletonDemesOriginSampler<'h, M, <AlmostInfiniteNormalDispersalScenario as Scenario<M, G>>::Habitat, I> where G: 'h

§

type OriginSamplerAuxiliary = (Sample,)

§

type SpeciationProbability = UniformSpeciationProbability

§

type TurnoverRate = UniformTurnoverRate

source§

impl<M: MathsCore, G: RngCore<M>> Scenario<M, G> for NonSpatialScenario

§

type Decomposition = ModuloDecomposition

§

type DecompositionAuxiliary = ()

§

type DispersalSampler = NonSpatialDispersalSampler<M, G>

§

type Habitat = NonSpatialHabitat<M>

§

type LineageStore<L: LineageStore<M, Self::Habitat>> = L

§

type OriginSampler<'h, I: Iterator<Item = u64>> = NonSpatialOriginSampler<'h, M, I> where G: 'h

§

type OriginSamplerAuxiliary = ()

§

type SpeciationProbability = UniformSpeciationProbability

§

type TurnoverRate = UniformTurnoverRate

source§

impl<M: MathsCore, G: RngCore<M>> Scenario<M, G> for SpatiallyExplicitTurnoverMapScenario

§

type Decomposition = EqualDecomposition<M, <SpatiallyExplicitTurnoverMapScenario as Scenario<M, G>>::Habitat>

§

type DecompositionAuxiliary = ()

§

type DispersalSampler = InMemoryPackedSeparableAliasDispersalSampler<M, <SpatiallyExplicitTurnoverMapScenario as Scenario<M, G>>::Habitat, G>

§

type Habitat = InMemoryHabitat<M>

§

type LineageStore<L: LineageStore<M, Self::Habitat>> = L

§

type OriginSampler<'h, I: Iterator<Item = u64>> = InMemoryOriginSampler<'h, M, I> where G: 'h

§

type OriginSamplerAuxiliary = ()

§

type SpeciationProbability = UniformSpeciationProbability

§

type TurnoverRate = InMemoryTurnoverRate

source§

impl<M: MathsCore, G: RngCore<M>> Scenario<M, G> for SpatiallyExplicitUniformTurnoverScenario

§

type Decomposition = EqualDecomposition<M, <SpatiallyExplicitUniformTurnoverScenario as Scenario<M, G>>::Habitat>

§

type DecompositionAuxiliary = ()

§

type DispersalSampler = InMemoryPackedSeparableAliasDispersalSampler<M, <SpatiallyExplicitUniformTurnoverScenario as Scenario<M, G>>::Habitat, G>

§

type Habitat = InMemoryHabitat<M>

§

type LineageStore<L: LineageStore<M, Self::Habitat>> = L

§

type OriginSampler<'h, I: Iterator<Item = u64>> = InMemoryOriginSampler<'h, M, I> where G: 'h

§

type OriginSamplerAuxiliary = ()

§

type SpeciationProbability = UniformSpeciationProbability

§

type TurnoverRate = UniformTurnoverRate

source§

impl<M: MathsCore, G: RngCore<M>> Scenario<M, G> for SpatiallyImplicitScenario

§

type Decomposition = ModuloDecomposition

§

type DecompositionAuxiliary = ()

§

type DispersalSampler = SpatiallyImplicitDispersalSampler<M, G>

§

type Habitat = SpatiallyImplicitHabitat<M>

§

type LineageStore<L: LineageStore<M, Self::Habitat>> = L

§

type OriginSampler<'h, I: Iterator<Item = u64>> = SpatiallyImplicitOriginSampler<'h, M, I> where G: 'h

§

type OriginSamplerAuxiliary = ()

§

type SpeciationProbability = SpatiallyImplicitSpeciationProbability

§

type TurnoverRate = UniformTurnoverRate

source§

impl<M: MathsCore, G: RngCore<M>> Scenario<M, G> for WrappingNoiseScenario

§

type Decomposition = RadialDecomposition

§

type DecompositionAuxiliary = ()

§

type DispersalSampler = WrappingNoiseApproximateNormalDispersalSampler<M, G>

§

type Habitat = WrappingNoiseHabitat<M>

§

type LineageStore<L: LineageStore<M, Self::Habitat>> = SingletonDemesLineageStore<M, <WrappingNoiseScenario as Scenario<M, G>>::Habitat>

§

type OriginSampler<'h, I: Iterator<Item = u64>> = SingletonDemesRectangleOriginSampler<'h, M, <WrappingNoiseScenario as Scenario<M, G>>::Habitat, I> where G: 'h

§

type OriginSamplerAuxiliary = (LandscapeExtent,)

§

type SpeciationProbability = UniformSpeciationProbability

§

type TurnoverRate = UniformTurnoverRate