refactor: update random number generation to use rand::make_rng() and upgrade rand to version 0.10

This commit is contained in:
Manuel Raimann
2026-02-10 09:30:39 +01:00
parent d7ad3f60db
commit 0e8fc82201
6 changed files with 12 additions and 18 deletions
+4 -4
View File
@@ -60,7 +60,7 @@ use std::sync::Arc;
use parking_lot::Mutex;
use rand::rngs::StdRng;
use rand::{Rng, SeedableRng};
use rand::{RngExt, SeedableRng};
use crate::distribution::Distribution;
use crate::error::{Error, Result};
@@ -149,7 +149,7 @@ impl TpeSampler {
n_startup_trials: 10,
n_ei_candidates: 24,
kde_bandwidth: None,
rng: Mutex::new(StdRng::from_os_rng()),
rng: Mutex::new(rand::make_rng()),
}
}
@@ -251,7 +251,7 @@ impl TpeSampler {
let rng = match seed {
Some(s) => StdRng::seed_from_u64(s),
None => StdRng::from_os_rng(),
None => rand::make_rng(),
};
Ok(Self {
@@ -857,7 +857,7 @@ impl TpeSamplerBuilder {
let rng = match self.seed {
Some(s) => StdRng::seed_from_u64(s),
None => StdRng::from_os_rng(),
None => rand::make_rng(),
};
Ok(TpeSampler {