|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.epochx.core.GPCrossover<TYPE>
public class GPCrossover<TYPE>
This class performs the very simple task of linking together parent selection and crossover. The actual tasks of crossover and selection are performed by Crossover and ProgramSelector implementations respectively.
Crossover,
UniformPointCrossover,
KozaCrossover,
ProgramSelector| Constructor Summary | |
|---|---|
GPCrossover(GPModel<TYPE> model)
Constructs an instance of GPCrossover which will setup the crossover operation. |
|
| Method Summary | |
|---|---|
CandidateProgram<TYPE>[] |
crossover()
Selects two parents by calling getProgramSelector() on the
instance of GPModel given at construction and submits them
to the Crossover operator which is obtained by calling
getCrossover() on the model. |
int |
getRevertedCount()
After a crossover is made, the controlling model is requested to confirm the crossover by a call to acceptCrossover(). |
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 GPCrossover(GPModel<TYPE> model)
Crossover returned by the models
getCrossover() method.
model - the GPModel which defines the Crossover operator and
ProgramSelector to use to perform one act of crossover on
a population.Crossover| Method Detail |
|---|
public CandidateProgram<TYPE>[] crossover()
getProgramSelector() on the
instance of GPModel given at construction and submits them
to the Crossover operator which is obtained by calling
getCrossover() on the model.
After a crossover is made, the controlling model is requested to
confirm the crossover by a call to acceptCrossover(). This
gives the model total control over whether a crossover is allowed to
proceed. If acceptCrossover() returns false
then the children are discarded and two new parents are selected and
attempted for crossover. The number of times the crossover was reverted
before being accepted is available through a call to
getRevertedCount().
Even after a crossover has been accepted by the model, it may still be prevented from proceeding if the program depth of either of the children exceeds the max depth that the model defines. In the case that the children do exceed the limit then the parents are returned as the result. This does not count towards the number of reversions.
public int getRevertedCount()
After a crossover is made, the controlling model is requested to
confirm the crossover by a call to acceptCrossover(). This
gives the model total control over whether a crossover is allowed to
proceed. If acceptCrossover() returns false
then the children are discarded and two new parents are selected and
attempted for crossover. The number of times the crossover 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 | |||||||||