pub trait ActiveLineageSampler<M: MathsCore, H: Habitat<M>, G: RngCore<M>, S: LineageStore<M, H>, X: EmigrationExit<M, H, G, S>, D: DispersalSampler<M, H, G>, C: CoalescenceSampler<M, H, S>, T: TurnoverRate<M, H>, N: SpeciationProbability<M, H>, E: EventSampler<M, H, G, S, X, D, C, T, N>, I: ImmigrationEntry<M>>: Backup + Debug {
    type LineageIterator<'a>: Iterator<Item = &'a Lineage>
       where M: 'a,
             H: 'a,
             S: 'a,
             Self: 'a;

    // Provided methods
    fn number_active_lineages(&self) -> usize { ... }
    fn iter_active_lineages_ordered<'a>(
        &'a self,
        habitat: &'a H,
        lineage_store: &'a S
    ) -> Self::LineageIterator<'a> { ... }
    fn get_last_event_time(&self) -> NonNegativeF64 { ... }
    fn pop_active_lineage_and_event_time<P: FnOnce(PositiveF64) -> ControlFlow<(), ()>>(
        &mut self,
        simulation: &mut PartialSimulation<M, H, G, S, X, D, C, T, N, E>,
        rng: &mut G,
        early_peek_stop: P
    ) -> Option<(Lineage, PositiveF64)> { ... }
    fn push_active_lineage(
        &mut self,
        lineage: Lineage,
        simulation: &mut PartialSimulation<M, H, G, S, X, D, C, T, N, E>,
        rng: &mut G
    ) { ... }
}

Required Associated Types§

source

type LineageIterator<'a>: Iterator<Item = &'a Lineage> where M: 'a, H: 'a, S: 'a, Self: 'a

Provided Methods§

source

fn number_active_lineages(&self) -> usize

source

fn iter_active_lineages_ordered<'a>( &'a self, habitat: &'a H, lineage_store: &'a S ) -> Self::LineageIterator<'a>

source

fn get_last_event_time(&self) -> NonNegativeF64

source

fn pop_active_lineage_and_event_time<P: FnOnce(PositiveF64) -> ControlFlow<(), ()>>( &mut self, simulation: &mut PartialSimulation<M, H, G, S, X, D, C, T, N, E>, rng: &mut G, early_peek_stop: P ) -> Option<(Lineage, PositiveF64)>

§Contracts

Post-condition - debug: removes an active lineage if Some(_) returned

  • match ret { Some(_) => { self.number_active_lineages() == old(self.number_active_lineages()) - 1 }, None => { self.number_active_lineages() == old(self.number_active_lineages()) }, }

Post-condition - debug: returns None if no lineages are left

  • old(self.number_active_lineages()) != 0 || ret.is_none()

Post-condition - debug: event occurs later than last event time

  • ret.is_none() || ret.as_ref().unwrap().1 > old(self.get_last_event_time())

Post-condition - debug: updates the time of the last event

  • if let Some((ref _lineage, event_time)) = ret { self.get_last_event_time() == event_time } else { true }
source

fn push_active_lineage( &mut self, lineage: Lineage, simulation: &mut PartialSimulation<M, H, G, S, X, D, C, T, N, E>, rng: &mut G )

§Contracts

Post-condition - debug: adds an active lineage

  • self.number_active_lineages() == old(self.number_active_lineages()) + 1

Post-condition - debug: updates the time of the last event

  • self.get_last_event_time() == old(lineage.last_event_time)

Object Safety§

This trait is not object safe.

Implementors§