style: apply rustfmt drift across the crate

This commit is contained in:
2026-05-05 11:40:14 -06:00
parent 84cee3f29e
commit 4a59041d1a
60 changed files with 1520 additions and 608 deletions
+10 -4
View File
@@ -27,7 +27,11 @@ pub struct TlboConfig {
impl Default for TlboConfig {
fn default() -> Self {
Self { population_size: 30, generations: 200, seed: 42 }
Self {
population_size: 30,
generations: 200,
seed: 42,
}
}
}
@@ -58,7 +62,10 @@ where
P: Problem<Decision = Vec<f64>> + Sync,
{
fn run(&mut self, problem: &P) -> OptimizationResult<P::Decision> {
assert!(self.config.population_size >= 2, "Tlbo population_size must be >= 2");
assert!(
self.config.population_size >= 2,
"Tlbo population_size must be >= 2"
);
let objectives = problem.objectives();
assert!(
objectives.is_single_objective(),
@@ -73,8 +80,7 @@ where
use crate::traits::Initializer as _;
self.bounds.initialize(n, &mut rng)
};
let mut evals: Vec<Evaluation> =
decisions.iter().map(|d| problem.evaluate(d)).collect();
let mut evals: Vec<Evaluation> = decisions.iter().map(|d| problem.evaluate(d)).collect();
let mut evaluations = decisions.len();
for _ in 0..self.config.generations {