org.encog.ml.ea.opp
Class CompoundOperator
- java.lang.Object
-
- org.encog.ml.ea.opp.CompoundOperator
-
- All Implemented Interfaces:
- java.io.Serializable, EvolutionaryOperator
public class CompoundOperator extends java.lang.Object implements EvolutionaryOperator, java.io.Serializable
A compound operator randomly chooses sub-operators to perform the actual operation. Each of the sub-operators can be provided with a weighting.- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor and Description CompoundOperator()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method and Description OperationListgetComponents()EvolutionaryAlgorithmgetOwner()voidinit(EvolutionaryAlgorithm theOwner)Called to setup the evolutionary operator.intoffspringProduced()intparentsNeeded()voidperformOperation(java.util.Random rnd, Genome[] parents, int parentIndex, Genome[] offspring, int offspringIndex)Perform the evolutionary operation.
-
-
-
Method Detail
-
getComponents
public OperationList getComponents()
- Returns:
- the components
-
getOwner
public EvolutionaryAlgorithm getOwner()
- Returns:
- the owner
-
init
public void init(EvolutionaryAlgorithm theOwner)
Called to setup the evolutionary operator.- Specified by:
initin interfaceEvolutionaryOperator- Parameters:
theOwner- The evolutionary algorithm used with this operator.
-
offspringProduced
public int offspringProduced()
- Specified by:
offspringProducedin interfaceEvolutionaryOperator- Returns:
- The number of offspring produced by this type of crossover.
-
parentsNeeded
public int parentsNeeded()
- Specified by:
parentsNeededin interfaceEvolutionaryOperator- Returns:
- The number of parents needed.
-
performOperation
public void performOperation(java.util.Random rnd, Genome[] parents, int parentIndex, Genome[] offspring, int offspringIndex)Perform the evolutionary operation.- Specified by:
performOperationin interfaceEvolutionaryOperator- Parameters:
rnd- A random number generator.parents- The parents.parentIndex- The index into the parents array.offspring- The offspring.offspringIndex- An index into the offspring array.
-
-
DMelt 3.0 © DataMelt by jWork.ORG