Skip to main content

Crossover

Trait Crossover 

Source
pub trait Crossover<G> {
    // Required method
    fn crossover<R: Rng + ?Sized>(
        &mut self,
        a: &G,
        b: &G,
        rng: &mut R,
    ) -> [G; 2];
}
Expand description

Produces two children from two parents.

Required Methods§

Source

fn crossover<R: Rng + ?Sized>(&mut self, a: &G, b: &G, rng: &mut R) -> [G; 2]

Returns two children of a and b.

Dyn Compatibility§

This trait is not dyn compatible.

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

Implementations on Foreign Types§

Source§

impl<G, X: Crossover<G> + ?Sized> Crossover<G> for &mut X

Source§

fn crossover<R: Rng + ?Sized>(&mut self, a: &G, b: &G, rng: &mut R) -> [G; 2]

Implementors§