JAGA Homepage

org.jaga.reproduction.greycodedNumbers
Class SimpleBinaryXOver

java.lang.Object
  extended by org.jaga.reproduction.XOver
      extended by org.jaga.reproduction.greycodedNumbers.SimpleBinaryXOver
All Implemented Interfaces:
ReproductionAlgorithm

public class SimpleBinaryXOver
extends XOver

TODO: Complete these comments.

Project: JAGA - Java API for Genetic Algorithms.

Company: University College London and JAGA.Org (http://www.jaga.org).

Copyright: (c) 2004 by G. Paperin.
This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, ONLY if you include a note of the original author(s) in any redistributed/modified copy.
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA or see http://www.gnu.org/licenses/gpl.html

Version:
JAGA public release 1.0 beta
Author:
Greg Paperin (greg@jaga.org)

Field Summary
private static java.lang.Class applicableClass
           
 
Constructor Summary
SimpleBinaryXOver()
           
SimpleBinaryXOver(double xOverProb)
           
 
Method Summary
private  int checkParentsTypeAndLength(Individual[] parents)
           
private  NDecimalsIndividual[] createKidsFromEncoding(GAParameterSet params, BitString c1, BitString c2)
           
 java.lang.Class getApplicableClass()
          Returns the class of individuals handled by this reproduction algorithm.
private  boolean kidsSatisfyConstraints(NDecimalsIndividual[] kids, GAParameterSet params)
           
protected  Individual[] makeCopyOfParents(Individual[] parents, GAParameterSet params)
           
 Individual[] reproduce(Individual[] parents, GAParameterSet params)
          Reproduces the specified individuals.
 
Methods inherited from class org.jaga.reproduction.XOver
getRequiredNumberOfParents, getXOverProbability, setXOverProbability
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

applicableClass

private static final java.lang.Class applicableClass
Constructor Detail

SimpleBinaryXOver

public SimpleBinaryXOver()

SimpleBinaryXOver

public SimpleBinaryXOver(double xOverProb)
Method Detail

getApplicableClass

public java.lang.Class getApplicableClass()
Description copied from interface: ReproductionAlgorithm
Returns the class of individuals handled by this reproduction algorithm.

Specified by:
getApplicableClass in interface ReproductionAlgorithm
Specified by:
getApplicableClass in class XOver
Returns:
The required type of the array-members in the parameter parents to the method ReproductionAlgorithm.reproduce.

reproduce

public Individual[] reproduce(Individual[] parents,
                              GAParameterSet params)
Description copied from interface: ReproductionAlgorithm
Reproduces the specified individuals.

Specified by:
reproduce in interface ReproductionAlgorithm
Specified by:
reproduce in class XOver
Parameters:
parents - The individuals to reproduce. The type of objects in this array must be the class returned by getApplicableClass. The number of objects in this array must be the same as returned by getRequiredNumberOfParents.
params - Experiment parameters.
Returns:
The children - i.e. the result of the reproduction of parents.

makeCopyOfParents

protected Individual[] makeCopyOfParents(Individual[] parents,
                                         GAParameterSet params)

checkParentsTypeAndLength

private int checkParentsTypeAndLength(Individual[] parents)
                               throws java.lang.IllegalArgumentException
Throws:
java.lang.IllegalArgumentException

kidsSatisfyConstraints

private boolean kidsSatisfyConstraints(NDecimalsIndividual[] kids,
                                       GAParameterSet params)

createKidsFromEncoding

private NDecimalsIndividual[] createKidsFromEncoding(GAParameterSet params,
                                                     BitString c1,
                                                     BitString c2)

JAGA Homepage

Go to JAGA Homepage