mss.ea.rec
Class IndividualRecombination
java.lang.Object
|
+--mss.ea.core.GeneticOperator
|
+--mss.ea.rec.Recombination
|
+--mss.ea.rec.IndividualRecombination
- All Implemented Interfaces:
- SingleStreamProcessor, StreamProcessor
- public class IndividualRecombination
- extends Recombination
- implements SingleStreamProcessor
Base class for recombination of two or more individuals.
- Since:
- 0.1
- Version:
- 0.1 (08-15-2001)
- Author:
- Andreas Rummler
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
crArray
protected ChromosomeRecombination[] crArray
- Array with recombination operators for chromosomes.
For every chromosome in the parents there must be a recombination operator in here, which is called while recombining.
IndividualRecombination
public IndividualRecombination(int craSize)
- Constructor with number of chromosomes of the parents.
The crArray is set up and will contain Null objects.
- Parameters:
craSize
- number of parent chromosomes
IndividualRecombination
public IndividualRecombination(ChromosomeRecombination[] cra)
- Constructor with array with chromosome recombination operators.
- Parameters:
cra
- array with chromosome recombination operators
updateQuantity
protected void updateQuantity()
- Recalculates the number of individuals this operator will produce.
This is called immediately after changing crArray.
updateRequired
protected void updateRequired()
- Recalculates the number of individuals this operator requires.
This is called immediately after changing crArray.
getOperator
public ChromosomeRecombination getOperator(int i)
- Gets a chromosome recombination operator.
- Parameters:
i
- index of the operator- Returns:
- chromosome recombination operator
setOperator
public void setOperator(ChromosomeRecombination cr,
int i)
- Sets a new chromosome recombination operator.
- Parameters:
cr
- new operatori
- index of the old operator
recombine
public Individual[] recombine(Individual[] ia)
throws RecombinationException
- Recombines a number of individuals.
This method will look at all chromosome recombination operators and will detect the minimal
number of child chromosomes. That's the minimal number of new individuals which can be produced.
If this behaviour should be changed, this method must be overloaded.
- Parameters:
ia
- array with parent individuals- Returns:
- array with child individuals
- Throws:
RecombinationException
- thrown if something goes wrong while recombining
recombine
public IndividualStream recombine(IndividualStream is)
throws RecombinationException
- Recombination of an individual stream.
- Parameters:
is
- individual stream- Returns:
- stream with created individuals
- Throws:
RecombinationException
- thrown, if a single recombination goes wrong
process
public Individual[] process(Individual[] ia)
process
public java.util.Vector process(java.util.Vector iv)
process
public IndividualStream process(IndividualStream is)
- Description copied from interface:
SingleStreamProcessor
- Processes an individual stream.
- Specified by:
process
in interface SingleStreamProcessor
- Following copied from interface:
mss.ea.core.SingleStreamProcessor
- Parameters:
is
- individual stream to process- Returns:
- processed stream of individuals
- Throws:
EAException
-
isSingleProcessor
public boolean isSingleProcessor()
isMultipleProcessor
public boolean isMultipleProcessor()
Copyright © 2000-2001 Technical University of Ilmenau, Department ESS