|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.epochx.core.GPMutation<TYPE>
public class GPMutation<TYPE>
This class performs the very simple task of linking together individual
selection and mutation. The actual tasks of crossover and selection are
performed by Mutation and ProgramSelector
implementations respectively.
Mutation,
PointMutation,
SubtreeMutation,
ProgramSelector| Constructor Summary | |
|---|---|
GPMutation(GPModel<TYPE> model)
Constructs an instance of GPMutation which will setup the mutation operation. |
|
| Method Summary | |
|---|---|
int |
getRevertedCount()
After a mutation is made, the controlling model is requested to confirm the mutation by a call to acceptMutation(). |
CandidateProgram<TYPE> |
mutate()
Selects a CandidateProgram from the population using the
ProgramSelector returned by a call to
getProgramSelector() on the model given at construction and
submits it to the Mutation operator which is obtained by
calling getMutation() on the model. |
void |
onGenerationStart()
Called after each generation. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public GPMutation(GPModel<TYPE> model)
Mutation returned by the models
getMutation() method.
model - the GPModel which defines the Mutation operator and
ProgramSelector to use to perform one act of mutation on
an individual in the population.Mutation| Method Detail |
|---|
public CandidateProgram<TYPE> mutate()
CandidateProgram from the population using the
ProgramSelector returned by a call to
getProgramSelector() on the model given at construction and
submits it to the Mutation operator which is obtained by
calling getMutation() on the model.
After a mutation is made, the controlling model is requested to
confirm the mutation by a call to acceptMutation(). This
gives the model total control over whether a mutation is allowed to
proceed. If acceptMutation() returns false
then the new CandidateProgram is discarded and a new
individual is selected and attempted for mutation. The number of times
the mutation was reverted before being accepted is available through
a call to getRevertedCount().
Even after a mutation has been accepted by the model, it may still be prevented from proceeding if the program depth of the new program exceeds the max depth that the model defines. In the case that it does exceed the limit then the original program is returned as the result. This does not count towards the number of reversions.
public int getRevertedCount()
After a mutation is made, the controlling model is requested to
confirm the mutation by a call to acceptMutation(). This
gives the model total control over whether a mutation is allowed to
proceed. If acceptMutation() returns false
then the mutated program is discarded and a new
CandidateProgram selected to undergo mutation. The number
of times the mutation was reverted before being accepted is available
through a call to this method.
public void onGenerationStart()
onGenerationStart in interface GenerationListener
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||