@@ -2,8 +2,7 @@ use std::{hint::unreachable_unchecked, marker::PhantomData};
22
33use necsim_core:: {
44 cogs:: {
5- distribution:: { Bernoulli , IndexUsize , UniformClosedOpenUnit } ,
6- ActiveLineageSampler , GloballyCoherentLineageStore , MathsCore , Rng , Samples ,
5+ ActiveLineageSampler , GloballyCoherentLineageStore , MathsCore , Rng ,
76 SeparableDispersalSampler , SplittableRng ,
87 } ,
98 reporter:: Reporter ,
@@ -21,6 +20,7 @@ use necsim_impls_no_std::{
2120 origin_sampler:: {
2221 decomposition:: DecompositionOriginSampler , pre_sampler:: OriginPreSampler ,
2322 } ,
23+ rng:: simple:: SimpleRng ,
2424 } ,
2525 parallelisation:: { self , Status } ,
2626} ;
@@ -38,15 +38,12 @@ use crate::arguments::{
3838pub fn initialise_and_simulate <
3939 ' p ,
4040 M : MathsCore ,
41- G : Rng < M , Generator : SplittableRng >
42- + Samples < M , IndexUsize >
43- + Samples < M , Bernoulli >
44- + Samples < M , UniformClosedOpenUnit > ,
45- O : Scenario < M , G > ,
41+ G : SplittableRng ,
42+ O : Scenario < M , SimpleRng < M , G > > ,
4643 R : Reporter ,
4744 P : LocalPartition < ' p , R > ,
4845 I : Iterator < Item = u64 > ,
49- L : EventSkippingLineageStoreSampleInitialiser < M , G , O , Error > ,
46+ L : EventSkippingLineageStoreSampleInitialiser < M , SimpleRng < M , G > , O , Error > ,
5047 Error ,
5148> (
5249 args : GillespieArguments ,
@@ -56,13 +53,15 @@ pub fn initialise_and_simulate<
5653 pause_before : Option < NonNegativeF64 > ,
5754 local_partition : & mut P ,
5855 lineage_store_sampler_initialiser : L ,
59- ) -> Result < SimulationOutcome < M , G > , Error >
56+ ) -> Result < SimulationOutcome < G > , Error >
6057where
6158 O :: LineageStore < GillespieLineageStore < M , O :: Habitat > > :
6259 GloballyCoherentLineageStore < M , O :: Habitat > ,
63- O :: DispersalSampler < InMemorySeparableAliasDispersalSampler < M , O :: Habitat , G > > :
64- SeparableDispersalSampler < M , O :: Habitat , G > ,
60+ O :: DispersalSampler < InMemorySeparableAliasDispersalSampler < M , O :: Habitat , SimpleRng < M , G > > > :
61+ SeparableDispersalSampler < M , O :: Habitat , SimpleRng < M , G > > ,
6562{
63+ let rng = SimpleRng :: from ( rng) ;
64+
6665 match args. parallelism_mode {
6766 ParallelismMode :: Monolithic => {
6867 let (
7271 speciation_probability,
7372 origin_sampler_auxiliary,
7473 _decomposition_auxiliary,
75- ) = scenario. build :: < InMemorySeparableAliasDispersalSampler < M , O :: Habitat , G > > ( ) ;
74+ ) = scenario
75+ . build :: < InMemorySeparableAliasDispersalSampler < M , O :: Habitat , SimpleRng < M , G > > > ( ) ;
7676 let coalescence_sampler = ConditionalCoalescenceSampler :: default ( ) ;
7777
7878 let ( lineage_store, dispersal_sampler, event_sampler, active_lineage_sampler) : (
@@ -127,8 +127,7 @@ where
127127 )
128128 . cloned ( )
129129 . collect ( ) ,
130- rng : simulation. rng_mut ( ) . clone ( ) ,
131- marker : PhantomData :: < M > ,
130+ rng : simulation. rng_mut ( ) . clone ( ) . into ( ) ,
132131 } ) ,
133132 }
134133 } ,
@@ -144,7 +143,8 @@ where
144143 speciation_probability,
145144 origin_sampler_auxiliary,
146145 decomposition_auxiliary,
147- ) = scenario. build :: < InMemorySeparableAliasDispersalSampler < M , O :: Habitat , G > > ( ) ;
146+ ) = scenario
147+ . build :: < InMemorySeparableAliasDispersalSampler < M , O :: Habitat , SimpleRng < M , G > > > ( ) ;
148148 let coalescence_sampler = ConditionalCoalescenceSampler :: default ( ) ;
149149
150150 let decomposition = O :: decompose (
0 commit comments