Trait Population

Source
pub trait Population<T>: Debug {
    // Required methods
    fn learn(&self) -> Distribution;
    fn sample(&mut self, distr: &mut Distribution) -> Result<(), Error>;
    fn to_permus(&self, permus: &mut PermuPopulation<T>) -> Result<(), Error>;
    fn from_permus(&mut self, permus: &PermuPopulation<T>) -> Result<(), Error>;
}
Expand description

Contains the methods a Population should have.

Required Methods§

Source

fn learn(&self) -> Distribution

Returns a Distribution learned from the current population.

Source

fn sample(&mut self, distr: &mut Distribution) -> Result<(), Error>

Fills the current population with samples sampled from a given Distribution.

Source

fn to_permus(&self, permus: &mut PermuPopulation<T>) -> Result<(), Error>

Fills the given PermuPopulation with the permutation vector representation of the current population .

Source

fn from_permus(&mut self, permus: &PermuPopulation<T>) -> Result<(), Error>

Maps a given PermuPopulation into the current Population’s representation.

Implementors§