Skip to main content

Repair

Trait Repair 

Source
pub trait Repair<G: ?Sized> {
    // Required method
    fn repair<R: Rng + ?Sized>(&mut self, genome: &mut G, rng: &mut R);
}
Expand description

Makes a genome valid again after variation (genotypic repair).

Phenotypic repair, which only adjusts the interpretation, belongs in the objective.

Required Methods§

Source

fn repair<R: Rng + ?Sized>(&mut self, genome: &mut G, rng: &mut R)

Repairs genome in place.

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: ?Sized, P: Repair<G> + ?Sized> Repair<G> for &mut P

Source§

fn repair<R: Rng + ?Sized>(&mut self, genome: &mut G, rng: &mut R)

Implementors§

Source§

impl Repair<Vec<f64>> for Clamp

Source§

impl Repair<Vec<f64>> for Reflect

Source§

impl Repair<Vec<u32>> for Domains

Clamps every gene into its domain.

Source§

impl Repair<Vec<usize>> for PlanRepair<'_>

Source§

impl Repair<Vec<usize>> for RemoveLoops

Source§

impl<G: ?Sized, A: Repair<G>, B: Repair<G>> Repair<G> for Then<A, B>

Source§

impl<G: ?Sized, F: FnMut(&mut G, &mut dyn Rng)> Repair<G> for RepairFn<F>

Source§

impl<G: ?Sized> Repair<G> for NoRepair