Algorithm::Genetic::Diploid::Experiment - manages an evolutionary experiment
Constructor takes named arguments. Provides defaults for mutation_rate (0.05), crossover_rate (0.60), reproduction_rate (0.35) and ngens (50).
mutation_rate
crossover_rate
reproduction_rate
ngens
Sets up the experiment based on the provided arguments:
'individual_count' => number of individuals in the population, default is 50 'chromosome_count' => number of chromosome pairs per individual, default is 1 'gene_count' => number of genes per chromosome, default is 1
Should be overridden in order to define an optimum fitness value at the provided generation.
Getter and setter for a Algorithm::Genetic::Diploid::Factory object (or subclass thereof), which instantiates other objects.
Getter and setter for a data object that gets passed to the gene functions
Getter and setter for the fraction of individuals in the population that gets to reproduce
Amount of change to apply to the weight and/or function of a gene.
Getter and setter for the proportion of genes that crossover
Getter and setter for the number of generations in the experiment
Getter and setter for the Algorithm::Genetic::Diploid::Population object
Runs the experiment!
Returns the number of distinct genes that remained after an experiment.
To install Algorithm::Genetic::Diploid, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Algorithm::Genetic::Diploid
CPAN shell
perl -MCPAN -e shell install Algorithm::Genetic::Diploid
For more information on module installation, please visit the detailed CPAN module installation guide.