pub trait Phenotype<G>: Clone + Debug where
G: Genotype, {
fn genes(&self) -> G;
fn derive(&self, new_genes: G) -> Self;
}
Expand description
A Phenotype
is a candidate solution of the optimization or search problem.
Phenotypes are also called individuals or creatures. A Phenotype
is the
type of data for which the optimal value for solving an optimization or
search problem should be found.
The Phenotype
represents a subject in the problem domain. It holds its
genes which are its representation in the search space of the genetic
algorithm. The genes are represented as a vector of Genotype
s.
Required methods
Returns its genes as a Genotype
.
Hint: The simulation may access this function several times. Therefore this method should be as fast as possible, e.g. through storing or caching the genes.