Struct revonet::context::EAContext [] [src]

pub struct EAContext<T: Individual + Serialize> {
    pub settings: EASettings,
    pub result: EAResult<T>,
    pub population: Vec<T>,
    pub fitness: Vec<f32>,
    pub sel_individuals: Vec<usize>,
    pub rng: StdRng,
}

Structure containing settings and intermetiade data required for an evolutionary algorithm to run.

Supposed to be passed around between different functions related to evolutionary algorithm.

Also stores statistics and results of the current run.

Fields

Settings of evolutionary algorithm.

Results of the current run containing fitness statistics across generations and the best found solution.

Population for current generation.

Fitness values ordered in the same way as population individuals.

Indices of population members selected for breeding.

RNG which is used by different functions of EA. Proper seeding should ensure reproducibility.

Methods

impl<T: Individual + Clone + Serialize + DeserializeOwned> EAContext<T>
[src]

Creates an EA context given current settings and reference to a problem. Also seeds RNG used in the EA.

Arguments:

  • settings - settings for evolutionary algorithm.
  • problem - reference to problem (objective function). Needed to initialize a population.

Trait Implementations

impl<T: Clone + Individual + Serialize> Clone for EAContext<T>
[src]

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more