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: EASettings
Settings of evolutionary algorithm.
result: EAResult<T>
Results of the current run containing fitness statistics across generations and the best found solution.
population: Vec<T>
Population for current generation.
fitness: Vec<f32>
Fitness values ordered in the same way as population individuals.
sel_individuals: Vec<usize>
Indices of population members selected for breeding.
rng: StdRng
RNG which is used by different functions of EA. Proper seeding should ensure reproducibility.
Methods
impl<T: Individual + Clone + Serialize + DeserializeOwned> EAContext<T>
[src]
fn new<P: Problem>(settings: EASettings, problem: &P) -> EAContext<T>
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]
fn clone(&self) -> EAContext<T>
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0
Performs copy-assignment from source
. Read more