galapagos

Crates.iogalapagos
lib.rsgalapagos
version1.0.0
created_at2024-12-30 16:20:21.829357+00
updated_at2024-12-30 22:40:39.17106+00
descriptionSimple evolutionary solver
homepage
repositoryhttps://github.com/wpcarro/galapagos
max_upload_size
id1499280
size48,862
William Carroll (wpcarro)

documentation

https://docs.rs/galapagos

README

Galapagos

Crates.io Docs.rs License: Unlicensed

Simple evolutionary solver written in Rust.

Graph of fitness over time

Usage

use matrix_rs::galapagos::{self, Goal};

fn main() {
    let solution = galapagos::solve(
        |xs| {
            // Rosenbrock: (a - x)^2 + b(y - x^2)^2
            let x = xs[0];
            let y = xs[1];
            (1.0 - x).powi(2) + 100.0 * (y - x.powi(2)).powi(2)
        },
        &[(-5.0, 5.0), (-5.0, 5.0)],
        Goal::Minimize,
        Default::default(),
    );
    println!("{solution:?}");
}
Commit count: 11

cargo fmt