|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.encog.ml.prg.opp.SubtreeMutation
public class SubtreeMutation
Perform a type-safe subtree mutation. The mutation point is chosen randomly, but the new tree will be generated with compatible types to the parent.
| Constructor Summary | |
|---|---|
SubtreeMutation(EncogProgramContext theContext,
int theMaxDepth)
Construct the subtree mutation object. |
|
| Method Summary | |
|---|---|
PrgGenerator |
getGenerator()
|
void |
init(EvolutionaryAlgorithm theOwner)
Called to setup the evolutionary operator. |
int |
offspringProduced()
|
int |
parentsNeeded()
|
void |
performOperation(Random rnd,
Genome[] parents,
int parentIndex,
Genome[] offspring,
int offspringIndex)
Perform the evolutionary operation. |
void |
setGenerator(PrgGenerator generator)
Set the random tree generator to use. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public SubtreeMutation(EncogProgramContext theContext,
int theMaxDepth)
theContext - The program context.theMaxDepth - The maximum depth.| Method Detail |
|---|
public PrgGenerator getGenerator()
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 EvolutionaryOperator
public void performOperation(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.public void setGenerator(PrgGenerator generator)
generator - The random tree generator.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||