JAGA Homepage

org.jaga.definitions
Interface IndividualsFactory

All Known Implementing Classes:
BooleanFormulaTreeFactory, NDecimalsIndividualSimpleFactory, ProteinLocationClassifierFactory

public interface IndividualsFactory

Basis for individual factories. Individuals should not have a public constructor, but be rather constructed by corresponding factories.

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)

Method Summary
 Individual createDefaultIndividual(GAParameterSet params)
          Creates a new default individual.
 Individual createRandomIndividual(GAParameterSet params)
          Creates a random individual according to this factory's current internal settings and expariment paramanters.
 Individual createSpecificIndividual(java.lang.Object init, GAParameterSet params)
          Creates a new individual and initialises it to the specified value(s).
 

Method Detail

createDefaultIndividual

Individual createDefaultIndividual(GAParameterSet params)
Creates a new default individual. For same factory settings, this method must always return the same individual (a new instance holding the same values), which is considered the defaut individual for those settings.

Parameters:
params - Experiment parameters.
Returns:
A new instance of the dafault individual for this factory's current settings.

createRandomIndividual

Individual createRandomIndividual(GAParameterSet params)
Creates a random individual according to this factory's current internal settings and expariment paramanters.

Parameters:
params - Experiment parameters.
Returns:
A new instanc eof a randomly created individual.

createSpecificIndividual

Individual createSpecificIndividual(java.lang.Object init,
                                    GAParameterSet params)
                                    throws java.lang.NullPointerException,
                                           java.lang.ClassCastException
Creates a new individual and initialises it to the specified value(s). The parameter init can hold any value(s) which this factory knows to interprete.
In particular, a factory should be able to handle Individual-objects of the same type as produced by the factory. If such an Individual-object is passed as the init-value, a deep copy of the individual should be created and returned by this method.
Any other type is permited for the init-value, but the value should not be null. This method should create a new individual and initialise it with the value(s) packed encoded in init.

Parameters:
init - Initialisation value(s) for a new individual.
params - Experiment parameters.
Returns:
A new instance of an individual produced by this factory, initialised to the value(s) specified in init.
Throws:
java.lang.NullPointerException - If init is null.
java.lang.ClassCastException - If init is of a type not supported by this factory for initalisation of individuals.

JAGA Homepage

Go to JAGA Homepage