Expand description
Map-Elites: A Quality Diversity Algorithm Implementation
This crate provides a generic, efficient implementation of the Map-Elites algorithm, which is used to discover diverse, high-performing solutions across a feature space.
§Example
use elites::{MapElites, MapElitesProblem};
// Define your problem
struct MyProblem;
impl MapElitesProblem for MyProblem {
type Genome = Vec<f64>;
fn random_genome(&self) -> Self::Genome {
vec![0.0, 0.0] // Simplified for example
}
fn evaluate(&self, genome: &Self::Genome) -> (f64, Vec<f64>) {
let fitness = -genome.iter().map(|x| x.powi(2)).sum::<f64>();
let features = vec![genome[0], genome[1]];
(fitness, features)
}
fn mutate(&self, genome: &Self::Genome) -> Self::Genome {
genome.clone() // Simplified for example
}
fn feature_dimensions(&self) -> usize { 2 }
fn bins_per_dimension(&self) -> usize { 10 }
}
// Use the algorithm
let problem = MyProblem;
let mut map_elites = MapElites::new(problem);
map_elites.run(1000);Structs§
- Individual
- Represents a solution in the Map-Elites algorithm
- MapElites
- The main Map-Elites implementation
- MapElites
Config - Configuration options for the Map-Elites algorithm
- Statistics
- Statistics collected during the evolution process
Traits§
- MapElites
Problem - Trait that defines the requirements for a problem to be solved using Map-Elites