heuropt 0.11.0

A practical Rust toolkit for heuristic single-, multi-, and many-objective optimization.
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
//! Trait for producing child decisions from parents.

use crate::core::rng::Rng;

/// Generates child decisions from parent decisions.
///
/// The optimizer chooses how many parents to pass. Implementations may return
/// any number of children; algorithms that require a specific count should
/// panic with a clear message if they do not get it.
pub trait Variation<D> {
    /// Produce children from the given parents.
    fn vary(&mut self, parents: &[D], rng: &mut Rng) -> Vec<D>;
}