| Crates.io | galapagos |
| lib.rs | galapagos |
| version | 1.0.0 |
| created_at | 2024-12-30 16:20:21.829357+00 |
| updated_at | 2024-12-30 22:40:39.17106+00 |
| description | Simple evolutionary solver |
| homepage | |
| repository | https://github.com/wpcarro/galapagos |
| max_upload_size | |
| id | 1499280 |
| size | 48,862 |
Simple evolutionary solver written in Rust.
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:?}");
}