eaLib API Docs
Last Modified : January 7 2002

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

Field Summary
protected  ChromosomeRecombination[] crArray
          Array with recombination operators for chromosomes.
 
Fields inherited from class mss.ea.rec.Recombination
quantity, required
 
Fields inherited from class mss.ea.core.GeneticOperator
description, ID, name
 
Constructor Summary
IndividualRecombination(ChromosomeRecombination[] cra)
          Constructor with array with chromosome recombination operators.
IndividualRecombination(int craSize)
          Constructor with number of chromosomes of the parents.
 
Method Summary
 ChromosomeRecombination getOperator(int i)
          Gets a chromosome recombination operator.
 boolean isMultipleProcessor()
           
 boolean isSingleProcessor()
           
 Individual[] process(Individual[] ia)
           
 IndividualStream process(IndividualStream is)
          Processes an individual stream.
 java.util.Vector process(java.util.Vector iv)
           
 Individual[] recombine(Individual[] ia)
          Recombines a number of individuals.
 IndividualStream recombine(IndividualStream is)
          Recombination of an individual stream.
 void setOperator(ChromosomeRecombination cr, int i)
          Sets a new chromosome recombination operator.
protected  void updateQuantity()
          Recalculates the number of individuals this operator will produce.
protected  void updateRequired()
          Recalculates the number of individuals this operator requires.
 
Methods inherited from class mss.ea.rec.Recombination
getQuantity, getRequired
 
Methods inherited from class mss.ea.core.GeneticOperator
getDescription, getID, getName, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface mss.ea.core.StreamProcessor
getName
 

Field Detail

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.
Constructor Detail

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
Method Detail

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 operator
i - 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()

eaLib API Docs
Last Modified : January 7 2002

Copyright © 2000-2001 Technical University of Ilmenau, Department ESS