Skip to main content

QdProblem

Trait QdProblem 

Source
pub trait QdProblem<G: ?Sized> {
    // Required method
    fn evaluate(&mut self, genome: &G, descriptor: &mut [f64]) -> f64;
}
Expand description

A problem for quality diversity: a cost to minimise and a behaviour descriptor.

Implemented for every FnMut(&G, &mut [f64]) -> f64 that writes the descriptor and returns the cost.

Required Methods§

Source

fn evaluate(&mut self, genome: &G, descriptor: &mut [f64]) -> f64

Writes the descriptor of genome into descriptor (of the grid’s dimension) and returns its cost (NaN counts as +∞).

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§

Source§

impl<G: ?Sized, F: FnMut(&G, &mut [f64]) -> f64> QdProblem<G> for F