From a380320131028aeb83ac1f016629d9d78bcb3dca Mon Sep 17 00:00:00 2001 From: Kacper Kafara Date: Wed, 1 May 2024 12:35:09 +0200 Subject: [PATCH] fmt --- examples/jssp/main.rs | 2 +- examples/jssp/problem/probe.rs | 6 +----- src/ga/operators/crossover/impls.rs | 2 +- src/ga/operators/mutation/impls.rs | 2 +- src/ga/operators/replacement/impls.rs | 2 +- src/ga/probe.rs | 8 ++------ tests/replacement_tests.rs | 2 +- 7 files changed, 8 insertions(+), 16 deletions(-) diff --git a/examples/jssp/main.rs b/examples/jssp/main.rs index 33edf84..85bba7b 100644 --- a/examples/jssp/main.rs +++ b/examples/jssp/main.rs @@ -14,7 +14,7 @@ use config::Config; use ecrs::ga::probe::{AggregatedProbe, ElapsedTime, PolicyDrivenProbe, ProbingPolicy}; use ecrs::prelude::{crossover, ga, ops, replacement, selection}; use ecrs::{ - ga::{Metrics, Individual, StdoutProbe}, + ga::{Individual, Metrics, StdoutProbe}, prelude::{ crossover::{CrossoverOperator, UniformParameterized}, mutation::{self, Identity}, diff --git a/examples/jssp/problem/probe.rs b/examples/jssp/problem/probe.rs index 235eeb3..a84ebf0 100644 --- a/examples/jssp/problem/probe.rs +++ b/examples/jssp/problem/probe.rs @@ -93,11 +93,7 @@ impl Probe for JsspProbe { info!(target: "iterinfo", "event_name,generation,eval_time,sel_time,cross_time,mut_time,repl_time,iter_time"); } - fn on_initial_population_created( - &mut self, - metadata: &ecrs::ga::Metrics, - population: &[JsspIndividual], - ) { + fn on_initial_population_created(&mut self, metadata: &ecrs::ga::Metrics, population: &[JsspIndividual]) { debug_assert_eq!(self.repeated.len(), 0); self.repeated.resize(population.len(), false); diff --git a/src/ga/operators/crossover/impls.rs b/src/ga/operators/crossover/impls.rs index 153cc16..84791ca 100644 --- a/src/ga/operators/crossover/impls.rs +++ b/src/ga/operators/crossover/impls.rs @@ -26,7 +26,7 @@ pub use uniform_parameterized::UniformParameterized; mod test { use crate::ga::individual::IndividualTrait; use crate::ga::operators::crossover::{CrossoverOperator, FixedPoint, Pmx, Ppx, Shuffle}; - use crate::ga::{Metrics, Individual}; + use crate::ga::{Individual, Metrics}; use std::iter::zip; #[test] diff --git a/src/ga/operators/mutation/impls.rs b/src/ga/operators/mutation/impls.rs index fb9e9cf..66718b9 100644 --- a/src/ga/operators/mutation/impls.rs +++ b/src/ga/operators/mutation/impls.rs @@ -260,7 +260,7 @@ where #[cfg(test)] mod tests { - use crate::ga::{individual::IndividualTrait, Metrics, Individual}; + use crate::ga::{individual::IndividualTrait, Individual, Metrics}; use itertools::Itertools; use rand::{distributions::Uniform, Rng}; diff --git a/src/ga/operators/replacement/impls.rs b/src/ga/operators/replacement/impls.rs index 0243e29..72fc262 100644 --- a/src/ga/operators/replacement/impls.rs +++ b/src/ga/operators/replacement/impls.rs @@ -182,7 +182,7 @@ impl ReplacementOperator for WeakPare #[cfg(test)] mod tests { - use crate::ga::{Metrics, Individual}; + use crate::ga::{Individual, Metrics}; use super::{BothParents, Noop, ReplacementOperator, WeakParent}; diff --git a/src/ga/probe.rs b/src/ga/probe.rs index e141871..6266120 100644 --- a/src/ga/probe.rs +++ b/src/ga/probe.rs @@ -116,12 +116,8 @@ pub trait Probe { /// See [GAMetadata] for reference. /// * `population` - Final population /// * `best_individual` - Best individual found by algorithm - fn on_end( - &mut self, - _metadata: &Metrics, - _population: &[IndividualT], - _best_individual: &IndividualT, - ) { /* defaults to noop */ + fn on_end(&mut self, _metadata: &Metrics, _population: &[IndividualT], _best_individual: &IndividualT) { + /* defaults to noop */ } } diff --git a/tests/replacement_tests.rs b/tests/replacement_tests.rs index 18396b7..9958c9e 100644 --- a/tests/replacement_tests.rs +++ b/tests/replacement_tests.rs @@ -3,7 +3,7 @@ use ecrs::ga::{ operators::replacement::{BothParents, Noop, ReplacementOperator}, population::{PopulationGenerator, RandomPoints}, - Metrics, Individual, + Individual, Metrics, }; #[test]