org.encog.ml.ea.opp
Class CompoundOperator

java.lang.Object
  extended by org.encog.ml.ea.opp.CompoundOperator
All Implemented Interfaces:
EvolutionaryOperator

public class CompoundOperator
extends Object
implements EvolutionaryOperator

A compound operator randomly chooses sub-operators to perform the actual operation. Each of the sub-operators can be provided with a weighting.


Constructor Summary
CompoundOperator()
           
 
Method Summary
 OperationList getComponents()
           
 EvolutionaryAlgorithm getOwner()
           
 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.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CompoundOperator

public CompoundOperator()
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:
init in interface EvolutionaryOperator
Parameters:
theOwner - The evolutionary algorithm used with this operator.

offspringProduced

public int offspringProduced()

Specified by:
offspringProduced in interface EvolutionaryOperator
Returns:
The number of offspring produced by this type of crossover.

parentsNeeded

public int parentsNeeded()

Specified by:
parentsNeeded in interface EvolutionaryOperator
Returns:
The number of parents needed.

performOperation

public void performOperation(Random rnd,
                             Genome[] parents,
                             int parentIndex,
                             Genome[] offspring,
                             int offspringIndex)
Perform the evolutionary operation.

Specified by:
performOperation in interface EvolutionaryOperator
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.


Copyright © 2014. All Rights Reserved.