diff --git a/Cargo.toml b/Cargo.toml index 050d102..74286c2 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -23,9 +23,9 @@ tokio = { version = "1", features = ["sync", "rt-multi-thread"], optional = true optimizer-derive = { version = "0.1", path = "optimizer-derive", optional = true } serde = { version = "1", features = ["derive"], optional = true } serde_json = { version = "1", optional = true } -tracing = { version = "0.1.26", optional = true } +tracing = { version = "0.1.44", optional = true } sobol_burley = { version = "0.5", optional = true } -nalgebra = { version = "0.34", optional = true } +nalgebra = { version = "0.35", optional = true } fs2 = { version = "0.4", optional = true } [features] @@ -40,7 +40,7 @@ cma-es = ["dep:nalgebra"] gp = ["dep:nalgebra"] [dev-dependencies] -tokio = { version = "1.50", features = ["rt-multi-thread", "macros", "time"] } +tokio = { version = "1.52", features = ["rt-multi-thread", "macros", "time"] } optimizer-derive = { version = "0.1.0", path = "optimizer-derive" } serde_json = "1" criterion = { version = "0.8", features = ["html_reports"] } diff --git a/src/sampler/genetic.rs b/src/sampler/genetic.rs index 6fbb9e0..852dc61 100644 --- a/src/sampler/genetic.rs +++ b/src/sampler/genetic.rs @@ -324,8 +324,8 @@ pub(crate) fn sbx_crossover_f64( (1.0 / (2.0 * (1.0 - u))).powf(1.0 / (eta + 1.0)) }; - let c1 = 0.5 * ((1.0 + beta) * p1 + (1.0 - beta) * p2); - let c2 = 0.5 * ((1.0 - beta) * p1 + (1.0 + beta) * p2); + let c1 = f64::midpoint((1.0 + beta) * p1, (1.0 - beta) * p2); + let c2 = f64::midpoint((1.0 - beta) * p1, (1.0 + beta) * p2); (c1.clamp(low, high), c2.clamp(low, high)) } diff --git a/src/sampler/random.rs b/src/sampler/random.rs index 22036b7..030c8d0 100644 --- a/src/sampler/random.rs +++ b/src/sampler/random.rs @@ -256,7 +256,7 @@ mod tests { if let ParamValue::Int(v) = value { assert!((0..=10).contains(&v)); // Check it's on the step grid: 0, 2, 4, 6, 8, 10 - assert!(v % 2 == 0); + assert_eq!(v % 2, 0); } else { panic!("Expected Int value"); }