Skip to content

Commit

Permalink
fmt
Browse files Browse the repository at this point in the history
  • Loading branch information
kkafar committed May 1, 2024
1 parent 01b8bd8 commit a380320
Show file tree
Hide file tree
Showing 7 changed files with 8 additions and 16 deletions.
2 changes: 1 addition & 1 deletion examples/jssp/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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},
Expand Down
6 changes: 1 addition & 5 deletions examples/jssp/problem/probe.rs
Original file line number Diff line number Diff line change
Expand Up @@ -93,11 +93,7 @@ impl Probe<JsspIndividual> 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);

Expand Down
2 changes: 1 addition & 1 deletion src/ga/operators/crossover/impls.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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]
Expand Down
2 changes: 1 addition & 1 deletion src/ga/operators/mutation/impls.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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};

Expand Down
2 changes: 1 addition & 1 deletion src/ga/operators/replacement/impls.rs
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,7 @@ impl<IndividualT: IndividualTrait> ReplacementOperator<IndividualT> for WeakPare

#[cfg(test)]
mod tests {
use crate::ga::{Metrics, Individual};
use crate::ga::{Individual, Metrics};

use super::{BothParents, Noop, ReplacementOperator, WeakParent};

Expand Down
8 changes: 2 additions & 6 deletions src/ga/probe.rs
Original file line number Diff line number Diff line change
Expand Up @@ -116,12 +116,8 @@ pub trait Probe<IndividualT: IndividualTrait> {
/// 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 */
}
}

Expand Down
2 changes: 1 addition & 1 deletion tests/replacement_tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
use ecrs::ga::{
operators::replacement::{BothParents, Noop, ReplacementOperator},
population::{PopulationGenerator, RandomPoints},
Metrics, Individual,
Individual, Metrics,
};

#[test]
Expand Down

0 comments on commit a380320

Please sign in to comment.