pub struct HillClimbBuilder<G: IncrementalGenotype, F: Fitness<Genotype = G>> {
    pub genotype: Option<G>,
    pub variant: Option<HillClimbVariant>,
    pub fitness: Option<F>,
    pub fitness_ordering: FitnessOrdering,
    pub multithreading: bool,
    pub max_stale_generations: Option<usize>,
    pub target_fitness_score: Option<FitnessValue>,
    pub valid_fitness_score: Option<FitnessValue>,
    pub scaling: Option<Scaling>,
}
Expand description

The builder for an HillClimb struct.

Fields§

§genotype: Option<G>§variant: Option<HillClimbVariant>§fitness: Option<F>§fitness_ordering: FitnessOrdering§multithreading: bool§max_stale_generations: Option<usize>§target_fitness_score: Option<FitnessValue>§valid_fitness_score: Option<FitnessValue>§scaling: Option<Scaling>

Implementations§

source§

impl<G: IncrementalGenotype, F: Fitness<Genotype = G>> Builder<G, F>

source

pub fn new() -> Self

source

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

source

pub fn call<R: Rng>( self, rng: &mut R ) -> Result<HillClimb<G, F>, TryFromBuilderError>

source

pub fn call_repeatedly<R: Rng>( self, max_repeats: usize, rng: &mut R ) -> Result<HillClimb<G, F>, TryFromBuilderError>

source

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

source

pub fn with_variant(self, variant: HillClimbVariant) -> Self

source

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

source

pub fn with_multithreading(self, multithreading: bool) -> Self

source

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

source

pub fn with_max_stale_generations(self, max_stale_generations: usize) -> Self

source

pub fn with_max_stale_generations_option( self, max_stale_generations_option: Option<usize> ) -> Self

source

pub fn with_target_fitness_score( self, target_fitness_score: FitnessValue ) -> Self

source

pub fn with_target_fitness_score_option( self, target_fitness_score_option: Option<FitnessValue> ) -> Self

source

pub fn with_valid_fitness_score(self, valid_fitness_score: FitnessValue) -> Self

source

pub fn with_valid_fitness_score_option( self, valid_fitness_score_option: Option<FitnessValue> ) -> Self

source

pub fn with_scaling(self, scaling: Scaling) -> Self

Trait Implementations§

source§

impl<G: Clone + IncrementalGenotype, F: Clone + Fitness<Genotype = G>> Clone for Builder<G, F>

source§

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

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 + IncrementalGenotype, F: Debug + Fitness<Genotype = G>> Debug for Builder<G, F>

source§

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

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

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

source§

fn default() -> Self

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

impl<G: IncrementalGenotype, F: Fitness<Genotype = G>> TryFrom<Builder<G, F>> for HillClimb<G, F>

§

type Error = TryFromBuilderError

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

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

Performs the conversion.

Auto Trait Implementations§

§

impl<G, F> RefUnwindSafe for Builder<G, F>where F: RefUnwindSafe, G: RefUnwindSafe,

§

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

§

impl<G, F> Sync for Builder<G, F>where G: Sync,

§

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

§

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

Blanket Implementations§

source§

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

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

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

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

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

source§

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

Mutably borrows from an owned value. 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 Twhere 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.

§

impl<T> Pointable for T

§

const ALIGN: usize = mem::align_of::<T>()

The alignment of pointer.
§

type Init = T

The type for initializers.
§

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

Initializes a with the given initializer. Read more
§

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

Dereferences the given pointer. Read more
§

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

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

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

impl<T> ToOwned for Twhere T: Clone,

§

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 Twhere U: Into<T>,

§

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 Twhere U: TryFrom<T>,

§

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.
§

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

§

fn vzip(self) -> V