public class SubtreeCrossover extends java.lang.Object implements EvolutionaryOperator
| Constructor and Description |
|---|
SubtreeCrossover()
Construct the operator with 1 crossover point.
|
SubtreeCrossover(int thePoints)
Construct the operator.
|
| Modifier and Type | Method and Description |
|---|---|
void |
init(EvolutionaryAlgorithm theOwner)
Called to setup the evolutionary operator.
|
int |
offspringProduced() |
int |
parentsNeeded() |
void |
performOperation(java.util.Random rnd,
Genome[] parents,
int parentIndex,
Genome[] offspring,
int offspringIndex)
Perform the evolutionary operation.
|
public SubtreeCrossover(int thePoints)
thePoints - The number of points.public SubtreeCrossover()
public void init(EvolutionaryAlgorithm theOwner)
init in interface EvolutionaryOperatortheOwner - The evolutionary algorithm used with this operator.public int offspringProduced()
offspringProduced in interface EvolutionaryOperatorpublic int parentsNeeded()
parentsNeeded in interface EvolutionaryOperatorpublic void performOperation(java.util.Random rnd,
Genome[] parents,
int parentIndex,
Genome[] offspring,
int offspringIndex)
performOperation in interface EvolutionaryOperatorrnd - A random number generator.parents - The parents.parentIndex - The index into the parents array.offspring - The offspring.offspringIndex - An index into the offspring array.