Struct PermutateBuilder

Source
pub struct PermutateBuilder<G: PermutateGenotype, F: Fitness<Genotype = G>, SR: StrategyReporter<Genotype = G>> {
    pub genotype: Option<G>,
    pub fitness: Option<F>,
    pub fitness_ordering: FitnessOrdering,
    pub par_fitness: bool,
    pub replace_on_equal_fitness: bool,
    pub reporter: SR,
}
Expand description

The builder for an Permutate struct.

Fields§

§genotype: Option<G>§fitness: Option<F>§fitness_ordering: FitnessOrdering§par_fitness: bool§replace_on_equal_fitness: bool§reporter: SR

Implementations§

Source§

impl<G: PermutateGenotype, F: Fitness<Genotype = G>> Builder<G, F, StrategyReporterNoop<G>>

Source

pub fn new() -> Self

Source§

impl<G: PermutateGenotype, F: Fitness<Genotype = G>, SR: StrategyReporter<Genotype = G>> Builder<G, F, SR>

Source

pub fn build(self) -> Result<Permutate<G, F, SR>, TryFromBuilderError>

Source

pub fn with_genotype(self, genotype: G) -> Self

Source

pub fn with_fitness_ordering(self, fitness_ordering: FitnessOrdering) -> Self

Source

pub fn with_par_fitness(self, par_fitness: bool) -> Self

Source

pub fn with_replace_on_equal_fitness( self, replace_on_equal_fitness: bool, ) -> Self

Source

pub fn with_fitness(self, fitness: F) -> Self

Source

pub fn with_reporter<SR2: StrategyReporter<Genotype = G>>( self, reporter: SR2, ) -> Builder<G, F, SR2>

Source§

impl<G: PermutateGenotype, F: Fitness<Genotype = G>, SR: StrategyReporter<Genotype = G>> Builder<G, F, SR>

Source

pub fn call(self) -> Result<Permutate<G, F, SR>, TryFromBuilderError>

Trait Implementations§

Source§

impl<G: Clone + PermutateGenotype, F: Clone + Fitness<Genotype = G>, SR: Clone + StrategyReporter<Genotype = G>> Clone for Builder<G, F, SR>

Source§

fn clone(&self) -> Builder<G, F, SR>

Returns a copy of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl<G: Debug + PermutateGenotype, F: Debug + Fitness<Genotype = G>, SR: Debug + StrategyReporter<Genotype = G>> Debug for Builder<G, F, SR>

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<G: PermutateGenotype, F: Fitness<Genotype = G>> Default for Builder<G, F, StrategyReporterNoop<G>>

Source§

fn default() -> Self

Returns the “default value” for a type. Read more
Source§

impl<G: PermutateGenotype, F: Fitness<Genotype = G>, SR: StrategyReporter<Genotype = G>> TryFrom<Builder<G, F, SR>> for Permutate<G, F, SR>

Source§

type Error = TryFromStrategyBuilderError

The type returned in the event of a conversion error.
Source§

fn try_from(builder: PermutateBuilder<G, F, SR>) -> Result<Self, Self::Error>

Performs the conversion.

Auto Trait Implementations§

§

impl<G, F, SR> Freeze for Builder<G, F, SR>
where SR: Freeze, G: Freeze, F: Freeze,

§

impl<G, F, SR> RefUnwindSafe for Builder<G, F, SR>

§

impl<G, F, SR> Send for Builder<G, F, SR>

§

impl<G, F, SR> Sync for Builder<G, F, SR>

§

impl<G, F, SR> Unpin for Builder<G, F, SR>
where SR: Unpin, G: Unpin, F: Unpin,

§

impl<G, F, SR> UnwindSafe for Builder<G, F, SR>
where SR: UnwindSafe, G: UnwindSafe, F: UnwindSafe,

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self>

Converts self into a Left variant of Either<Self, Self> if into_left is true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

Converts self into a Left variant of Either<Self, Self> if into_left(&self) returns true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

impl<T> Pointable for T

Source§

const ALIGN: usize

The alignment of pointer.
Source§

type Init = T

The type for initializers.
Source§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
Source§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
Source§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
Source§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V