@@ -275,7 +275,7 @@ pub mod simulation {
275275 where
276276 P : Into < Position > + Copy + PartialOrd ,
277277 {
278- let rng = & mut StdRng :: seed_from_u64 ( seed) ;
278+ let mut rng = StdRng :: seed_from_u64 ( seed) ;
279279 let intervals: Vec < ( Position , Position ) > = intervals
280280 . iter ( )
281281 . map ( |( a, b) | ( ( * a) . into ( ) , ( * b) . into ( ) ) )
@@ -330,8 +330,8 @@ pub mod simulation {
330330 for t in ( 0 ..start_time) . rev ( ) {
331331 for i in 0 ..pop_size {
332332 // select breakpoints
333- let breakpoint1 = find_breakpoint ( rng, seqlen. into ( ) ) ;
334- let breakpoint2 = find_breakpoint ( rng, seqlen. into ( ) ) ;
333+ let breakpoint1 = find_breakpoint ( & mut rng, seqlen. into ( ) ) ;
334+ let breakpoint2 = find_breakpoint ( & mut rng, seqlen. into ( ) ) ;
335335
336336 // find child pop
337337 let mut child_pop = pop_anc;
@@ -340,8 +340,8 @@ pub mod simulation {
340340 }
341341
342342 // find parents
343- let ( parent1, _parent1_pop) = find_parent ( rng, & parents, child_pop) ;
344- let ( parent2, _parent2_pop) = find_parent ( rng, & parents, child_pop) ;
343+ let ( parent1, _parent1_pop) = find_parent ( & mut rng, & parents, child_pop) ;
344+ let ( parent2, _parent2_pop) = find_parent ( & mut rng, & parents, child_pop) ;
345345
346346 // add individual
347347 let child_ind = add_ind ( & mut tables, parent1, parent2) ;
@@ -367,7 +367,7 @@ pub mod simulation {
367367 ] {
368368 add_edge ( & mut tables, s, e, p, c) ;
369369
370- let mut_pos = find_mutation_pos ( rng, s, e) ;
370+ let mut_pos = find_mutation_pos ( & mut rng, s, e) ;
371371 let mut mut_prob = f64:: from ( e - s) * mu;
372372 if mut_prob > 1.0 {
373373 mut_prob = 1.0 ;
0 commit comments