moors
Overview
moors is the core crate of the moo-rs project for solving multi-objective optimization problems with evolutionary algorithms. It's a pure-Rust crate for high-performance implementations of genetic algorithms
Features
- NSGA-II, NSGA-III, R-NSGA-II, Age-MOEA, REVEA (many more coming soon!)
- Pluggable operators: sampling, crossover, mutation, duplicates removal
- Flexible fitness & constraints via user-provided closures
- Built on ndarray and faer
Installation
[]
= "0.1.0-alpha.0"
Quickstart
use ;
use ;
// problem data
const WEIGHTS: = ;
const VALUES: = ;
const CAPACITY: f64 = 15.0;
/// Compute multi-objective fitness [–total_value, total_weight]
/// Returns an Array2<f64> of shape (population_size, 2)
// build and run the NSGA-II algorithm
let mut algorithm = default
.fitness_fn
.constraints_fn
.sampler
.crossover
.mutation
.duplicates_cleaner
.n_vars
.population_size
.crossover_rate
.mutation_rate
.num_offsprings
.num_iterations
.build
.unwrap;
algorithm.run.unwrap;
println!;
Contributing
Contributions welcome! Please read the contribution guide and open issues or PRs in the relevant crate’s repository
License
This project is licensed under the MIT License.