Move RNG gen to elsewhere

This commit is contained in:
Joshua Coles 2023-03-03 10:46:00 +00:00
parent 0752370ee7
commit fcda9726d5
2 changed files with 3 additions and 3 deletions

View File

@ -30,7 +30,7 @@ fn main() {
let cli = Cli::parse();
let mut sys = DLASystem::<SmallRng, VectorStorage, LocalRandomWalker>::new(
cli.seed,
SmallRng::seed_from_u64(cli.seed),
cli.max_particles,
cli.stick_probability
);

View File

@ -28,9 +28,9 @@ pub struct DLASystem<R: Rng, S: Storage, W: Walker<R>> {
}
impl<R: Rng, S: Storage, W: Walker<R>> DLASystem<R, S, W> {
pub fn new(seed: u64, max_particles: usize, stick_probability: f32) -> DLASystem<SmallRng, VectorStorage, LocalRandomWalker> {
pub fn new(rng: R, max_particles: usize, stick_probability: f32) -> DLASystem<R, VectorStorage, LocalRandomWalker> {
let mut sys: DLASystem<SmallRng, VectorStorage, LocalRandomWalker> = DLASystem {
rng: SmallRng::seed_from_u64(seed),
rng,
stick_probability,
max_particles,
running: true,