pub struct EvaluatedPopulation<G, F> where
    G: Genotype,
    F: Fitness
{ /* private fields */ }
Expand description

The EvaluatedPopulation holds the results of the evaluation stage of the genetic algorithm. It is used to pass these values to the operator::SelectionOp to enable this operator to do its job.

Currently it contains the fitness value of each individual in a population, their normalized fitness values and highest and average fitness of the population.

As the information in this struct is only used to pass the output of the evaluation stage to the selection operator and this happens once for every population the types of the fields are designed to avoid cloning of whole data structures. To be able to change the fields internally later when new optimization are found the fields are kept private.

Implementations

Construct a new instance of the EvaluatedPopulation struct.

Returns the individuals of the population that has been evaluated.

Returns the fitness values of all individuals of the evaluated population.

The returned slice contains the fitness values of the individuals in the same order as the slice returned by function individuals contains the individuals itself, i.e. for individual with index i in individuals()[i] the fitness value is stored in fitness_values()[i].

Returns the highest genetic::Fitness value found in the evaluated population.

Returns the lowest genetic::Fitness value found in the evaluated population.

Returns the average of all genetic::Fitness values of the evaluated population.

Returns the individual at the given index.

Returns the genetic::Fitness value of the given individual.

Note: This function might be more expensive due to the data structure chosen for this struct. So use it sparingly.

Returns the genetic::Genotype of the individual with a given genetic::Fitness value.

Note: This function might be more expensive due to the data structure chosen for this struct. So use it sparingly.

Returns the Evaluated individual with a given genetic::Fitness value.

Note: This function might be more expensive due to the data structure chosen for this struct. So use it sparingly.

Trait Implementations

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

Formats the value using the given formatter. Read more

This method tests for self and other values to be equal, and is used by ==. Read more

This method tests for !=.

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

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

The alignment of pointer.

The type for initializers.

Initializes a with the given initializer. Read more

Dereferences the given pointer. Read more

Mutably dereferences the given pointer. Read more

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

The resulting type after obtaining ownership.

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

🔬 This is a nightly-only experimental API. (toowned_clone_into)

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

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.