Struct differential_evolution::Population
[−]
[src]
pub struct Population<F, R> where F: Fn(&[f32]) -> f32, R: Rng {
// some fields omitted
}
Holds the population for the differential evolution based on the given settings.
Methods
impl<F, R> Population<F, R> where F: Fn(&[f32]) -> f32, R: Rng
[src]
fn new(s: Settings<F, R>) -> Population<F, R>
Creates a new population based on the given settings.
fn best(&self) -> Option<(f32, &[f32])>
Gets a tuple of the best cost and best position found so far.
fn num_cost_evaluations(&self) -> usize
Gets the total number of times the cost function has been evaluated.
fn eval(&mut self) -> Option<f32>
Performs a single cost evaluation, and updates best positions and evolves the population if the whole population has been evaluated. Returns the cost value of the current best solution found.
fn iter(&mut self) -> PopIter<F, R>
Gets an iterator for this population. Each call to next()
performs one cost evaluation.