pub mod build; pub mod inspect; #[allow(unused_imports)] pub use approx::relative_eq; pub use approx::RelativeEq; #[allow(unused_imports)] pub use genetic_algorithm::chromosome::{ BinaryChromosome, Chromosome, ListChromosome, RangeChromosome, }; #[allow(unused_imports)] pub use genetic_algorithm::genotype::{BinaryGenotype, Genotype, ListGenotype, RangeGenotype}; #[allow(unused_imports)] pub use genetic_algorithm::population::Population; #[allow(unused_imports)] pub use num::BigUint; #[allow(unused_imports)] pub use rand::rngs::SmallRng; #[allow(unused_imports)] pub use rand::SeedableRng; #[allow(dead_code)] pub fn relative_chromosome_eq + Clone + Copy + std::fmt::Debug>( a: Vec, b: Vec, epsilon: T, ) -> bool { let result = if a.len() == b.len() { a.iter() .zip(b.iter()) .all(|(a, b)| a.relative_eq(b, epsilon, epsilon)) } else { false }; if result { true } else { println!("{:?} <> {:?}", a, b); false } } #[allow(dead_code)] pub fn relative_population_eq + Clone + Copy + std::fmt::Debug>( a: Vec>, b: Vec>, epsilon: T, ) -> bool { let result = if a.len() == b.len() { a.iter() .zip(b.iter()) .all(|(a, b)| relative_chromosome_eq(a.to_vec(), b.to_vec(), epsilon)) } else { println!("{:?} <> {:?}", a, b); false }; if result { true } else { println!("{:?} <> {:?}", a, b); false } }