ecrs 0.1.0-beta.4

Evolutionary computation tools & algorithms
Documentation
#![cfg(feature = "ga")]

use ecrs::{ga, test_functions};
mod util;

fn main() {
    let _ = util::init_logging();

    let best_individual = ga::Builder::with_rvc()
        .set_max_duration(std::time::Duration::from_secs(5))
        .fitness_fn(|x| -test_functions::ackley(x))
        .dim(4)
        .build()
        .run()
        .unwrap();

    println!("4D ackley function zero approximation {best_individual:#?}")
}

#[cfg(not(feature = "ga"))]
fn main() {
    panic!("Required feature \"ga\" is not enabled");
}