[][src]Struct jeans::Settings

pub struct Settings {
    pub population_size: u32,
    pub number_of_generations: u32,
    pub crossover_probability: f64,
    pub mutation_probability: f64,
    pub verbose: bool,
    pub elitism: bool,
    pub elitism_fraction: f64,
    pub maximize_fitness: bool,
    pub number_of_dimensions: u32,
    pub upper_bound: Vec<f64>,
    pub lower_bound: Vec<f64>,
    pub fitness_function: Box<dyn FnMut(Vec<f64>) -> f64>,
}

This is a settings object for storing all of the settings we might care about for a GA.

Fields

population_size: u32

The size of the population

number_of_generations: u32

The number of generations

crossover_probability: f64

The crossover probability

mutation_probability: f64

The probability of mutation

verbose: bool

A bool indicating whether or not code should run in verbose mode

elitism: bool

A bool indicating whether or not to implement elitism

elitism_fraction: f64
maximize_fitness: bool
number_of_dimensions: u32
upper_bound: Vec<f64>
lower_bound: Vec<f64>
fitness_function: Box<dyn FnMut(Vec<f64>) -> f64>

The fitness function used to evaluate how good solutions are

Implementations

impl Settings[src]

pub fn set_fitness_function<F: 'static + FnMut(Vec<f64>) -> f64>(
    &mut self,
    f: F
)
[src]

This functions allows you to set the fitness function

Trait Implementations

impl Default for Settings[src]

Default values for all settings

Auto Trait Implementations

impl !RefUnwindSafe for Settings

impl !Send for Settings

impl !Sync for Settings

impl Unpin for Settings

impl !UnwindSafe for Settings

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

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

The type returned in the event of a conversion error.

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