|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
TYPE - The return type of CandidatePrograms being evolved.public interface GPModel<TYPE>
A GPModel defines all those parameters needed to control a run by GPRun. The first step - and for most problems the only step - to generate a GP evolved solution with EpochX is to provide a concrete implementation of this interface.
For most situations, users should look to extend the abstract
GPAbstractModel.
GPAbstractModel| Method Summary | |
|---|---|
boolean |
acceptCrossover(CandidateProgram<TYPE>[] parents,
CandidateProgram<TYPE>[] children)
This method will be called during each crossover operation before the crossover is accepted, giving the model the opportunity to reject the operation, in which case the operation will be attempted again until it is accepted. |
boolean |
acceptMutation(CandidateProgram<TYPE> parent,
CandidateProgram<TYPE> child)
This method will be called during each mutation operation before the mutation is accepted, giving the model the opportunity to reject the operation, in which case the operation will be attempted again until it is accepted. |
Crossover<TYPE> |
getCrossover()
Retrieves the implementation of Crossover to use to perform the genetic operation of crossover between 2 parents. |
double |
getCrossoverProbability()
Retrieves a numerical value between 0.0 and 1.0 which represents the probability of selecting the crossover genetic operator, as opposed to mutation or reproduction. |
CrossoverStatListener |
getCrossoverStatListener()
Get a listener which will be informed of statistics about crossovers. |
double |
getFitness(CandidateProgram<TYPE> program)
Calculates and returns the fitness score of the given program. |
java.util.List<FunctionNode<TYPE>> |
getFunctions()
Retrieves the set of function nodes. |
GenerationStatListener |
getGenerationStatListener()
Get a listener which will be informed of statistics about generations. |
Initialiser<TYPE> |
getInitialiser()
Retrieves the Initialiser which will generate the first generation population from which the evolution will proceed. |
int |
getInitialMaxDepth()
Retrieves the maximum depth of CandidatePrograms allowed in the population after initialisation. |
LifeCycleListener<TYPE> |
getLifeCycleListener()
Get a listener which will be informed of each stage of a GP run's life cycle, and given the facility to confirm or modify each step. |
int |
getMaxProgramDepth()
Retrieves the maximum depth of CandidatePrograms allowed in the population after undergoing genetic operators. |
double |
getMutationProbability()
Retrieves a numerical value between 0.0 and 1.0 which represents the probability of selecting the mutation genetic operator, as opposed to crossover or reproduction. |
MutationStatListener |
getMutationStatListener()
Get a listener which will be informed of statistics about mutations. |
Mutation<TYPE> |
getMutator()
Retrieves the implementation of Mutator to use to perform the genetic operation of mutation on a CandidateProgram. |
int |
getNoElites()
Retrieves the number of elites that should be copied straight to the next population. |
int |
getNoGenerations()
Retrieves the number of generations that each run should use before terminating, unless prior termination occurs due to one of the other termination criterion. |
int |
getNoRuns()
Retrieves the number of runs that should be carried out using this model as the basis. |
PoolSelector<TYPE> |
getPoolSelector()
Retrieves the selector to use to construct a breeding pool from which parents can be selected using the parent selector returned by getProgramSelector() to undergo the genetic operators. |
int |
getPoolSize()
Retrieves the size of the breeding pool to be used for parent selection when performing the genetic operators. |
int |
getPopulationSize()
Retrieves the number of CandidatePrograms that should make up each generation. |
ProgramSelector<TYPE> |
getProgramSelector()
Retrieves the selector to use to pick parents from either a pre-selected breeding pool (selected by the PoolSelector returned by getPoolSelector()) or the previous population for use as input to the genetic operators. |
double |
getReproductionProbability()
Retrieves a numerical value between 0.0 and 1.0 which represents the probability of selecting the reproduction genetic operator, as opposed to crossover or mutation. |
RandomNumberGenerator |
getRNG()
Returns the RandomNumberGenerator instance that should be used for the generation of random numbers throughout execution. |
RunStatListener |
getRunStatListener()
Get a listener which will be informed of statistics about runs. |
java.util.List<Node<TYPE>> |
getSyntax()
Retrieves the full set of syntax, that is terminals AND function nodes. |
java.util.List<TerminalNode<TYPE>> |
getTerminals()
Retrieves the set of terminal nodes. |
double |
getTerminationFitness()
The fitness score at which a run should be stopped. |
| Method Detail |
|---|
Initialiser<TYPE> getInitialiser()
Crossover<TYPE> getCrossover()
UniformPointCrossover,
KozaCrossoverMutation<TYPE> getMutator()
ProgramSelector<TYPE> getProgramSelector()
TournamentSelectorPoolSelector<TYPE> getPoolSelector()
TournamentSelectorjava.util.List<TerminalNode<TYPE>> getTerminals()
java.util.List<FunctionNode<TYPE>> getFunctions()
java.util.List<Node<TYPE>> getSyntax()
RandomNumberGenerator getRNG()
int getNoRuns()
int getNoGenerations()
int getPopulationSize()
int getPoolSize()
int getNoElites()
int getInitialMaxDepth()
int getMaxProgramDepth()
double getCrossoverProbability()
Within one generation approximately Pc proportion of the CandidatePrograms will have been created through crossover, Pm through mutation and Pr through reproduction. Where Pc, Pm, Pr are the values returned by getCrossoverProbability(), getMutationProbability() and getReproductionProbability() respectively. The sum of the calls to getCrossoverProbability(), getReproductionProbability() and getMutationProbability() should total 1.0.
double getMutationProbability()
Within one generation approximately Pc proportion of the CandidatePrograms will have been created through crossover, Pm through mutation and Pr through reproduction. Where Pc, Pm, Pr are the values returned by getCrossoverProbability(), getMutationProbability() and getReproductionProbability() respectively. The sum of the calls to getCrossoverProbability(), getReproductionProbability() and getMutationProbability() should total 1.0.
double getReproductionProbability()
Within one generation approximately Pc proportion of the CandidatePrograms will have been created through crossover, Pm through mutation and Pr through reproduction. Where Pc, Pm, Pr are the values returned by getCrossoverProbability(), getMutationProbability() and getReproductionProbability() respectively. The sum of the calls to getCrossoverProbability(), getReproductionProbability() and getMutationProbability() should total 1.0.
double getFitness(CandidateProgram<TYPE> program)
There are many ways in which a fitness score can be calculated, for example mean squared error, standard deviation or a simple count of how many known inputs the given program provides incorrect (known) outputs. For more information, the new user should read some of the genetic programming literature.
program - the CandidateProgram to evaluate and calculate a score
for.
double getTerminationFitness()
boolean acceptCrossover(CandidateProgram<TYPE>[] parents,
CandidateProgram<TYPE>[] children)
parents - The programs which have been crossed over to create the
given children.children - The children which are the result of the crossover
operation having been performed on the given parents.
boolean acceptMutation(CandidateProgram<TYPE> parent,
CandidateProgram<TYPE> child)
parent - The program before the mutation operation.child - The program after the mutation operation has been carried
out.
RunStatListener getRunStatListener()
GenerationStatListener getGenerationStatListener()
CrossoverStatListener getCrossoverStatListener()
MutationStatListener getMutationStatListener()
LifeCycleListener<TYPE> getLifeCycleListener()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||