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§
Sourcefn learn(&self) -> Distribution
fn learn(&self) -> Distribution
Returns a Distribution
learned from the current population.
Sourcefn sample(&mut self, distr: &mut Distribution) -> Result<(), Error>
fn sample(&mut self, distr: &mut Distribution) -> Result<(), Error>
Fills the current population with samples sampled from a given Distribution
.
Sourcefn to_permus(&self, permus: &mut PermuPopulation<T>) -> Result<(), Error>
fn to_permus(&self, permus: &mut PermuPopulation<T>) -> Result<(), Error>
Fills the given PermuPopulation
with the permutation vector
representation of the current population .
Sourcefn from_permus(&mut self, permus: &PermuPopulation<T>) -> Result<(), Error>
fn from_permus(&mut self, permus: &PermuPopulation<T>) -> Result<(), Error>
Maps a given PermuPopulation
into the current Population
’s representation.