[][src]Struct optlib::genetic::Population

pub struct Population<T: Clone> { /* fields omitted */ }

Stores all individuals for current generation.

T - type of a point in the search space for goal function (chromosomes).

Methods

impl<T: Clone> Population<T>[src]

pub fn iter(&self) -> Iter<Individual<T>>[src]

Returns iterator for all individuals (Individual struct) in population.

pub fn iter_mut(&mut self) -> IterMut<Individual<T>>[src]

Returns mut iterator for all individuals (Individual struct) in population.

pub fn get_iteration(&self) -> usize[src]

Returns iteration number (generation number).

pub fn len(&self) -> usize[src]

Returns count of the individuals in the population.

pub fn len_alive(&self) -> usize[src]

Return count of live individuals

pub fn get_best(&self) -> &Option<Individual<T>>[src]

Returns the best individual in the population if exists or None otherwise.

pub fn get_worst(&self) -> &Option<Individual<T>>[src]

Returns the worst individual in the population if exists or None otherwise.

Trait Implementations

impl<T: Clone> Index<usize> for Population<T>[src]

Index trait implementation for Population

type Output = Individual<T>

The returned type after indexing.

impl<T: Clone> IndexMut<usize> for Population<T>[src]

IndexMut trait implementation for Population

Auto Trait Implementations

impl<T> !Send for Population<T>

impl<T> !Sync for Population<T>

Blanket Implementations

impl<T> From for T[src]

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

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

type Error = Infallible

The type returned in the event of a conversion error.

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

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

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

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

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

The type returned in the event of a conversion error.