All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class evolution.GeneticFactoryImpl

java.lang.Object
   |
   +----evolution.GeneticFactoryImpl

public abstract class GeneticFactoryImpl
extends Object
implements GeneticFactory
Default partial implementation of GeneticFactory. To be precise, I implement all methods that may be implemented without making assumptions on the concrete evolution type.


Variable Index

 o rg

Constructor Index

 o GeneticFactoryImpl()
Create myself with the default RandomGenerator seeded with a random seed.
 o GeneticFactoryImpl(byte[])
Create myself with the default RandomGenerator seeded with the specified seed.
 o GeneticFactoryImpl(RandomGenerator)
Create myself with the given random generator.
 o GeneticFactoryImpl(RandomGenerator, byte[])
Create myself with the given random generator and seed.

Method Index

 o getEvaluator()
 o getNumParents()
Return the number of individuals that need to copulate for the creation of a child.
 o getRandomGenerator()
 o getSortingAlgorithm()
 o merge(Genome[], EvolutionParm)
Merge the parent genomes to produce a child genome.
 o newEmptyGenome()
 o newIndividual()
Create a new individual.
 o offspring(Individual[], EvolutionParm)
Produce a child from the parents' genomes.

Variables

 o rg
 protected RandomGenerator rg

Constructors

 o GeneticFactoryImpl
 public GeneticFactoryImpl(RandomGenerator r,
                           byte randomSeed[])
Create myself with the given random generator and seed.

 o GeneticFactoryImpl
 public GeneticFactoryImpl(RandomGenerator r)
Create myself with the given random generator.

 o GeneticFactoryImpl
 public GeneticFactoryImpl(byte seed[])
Create myself with the default RandomGenerator seeded with the specified seed.

 o GeneticFactoryImpl
 public GeneticFactoryImpl()
Create myself with the default RandomGenerator seeded with a random seed.

Methods

 o newIndividual
 public abstract Individual newIndividual() throws EvolutionException
Create a new individual.

Returns:
a new (random) Individual
 o getNumParents
 public abstract int getNumParents()
Return the number of individuals that need to copulate for the creation of a child. 1 is allowed, which amounts to a non-sexual evolution where the only genetic "input" is mutation.

Returns:
a natural number greater or equal to 1.
 o getEvaluator
 public abstract Evaluator getEvaluator()
Returns:
the Evaluator object used for this evolution.
 o newEmptyGenome
 protected abstract Genome newEmptyGenome()
Returns:
an empty new Genome
 o offspring
 public Individual offspring(Individual parents[],
                             EvolutionParm p) throws EvolutionException
Produce a child from the parents' genomes.

Throws: EvolutionException
if something goes wrong :-)
Throws: BadSizeException
if the number of prents is wrong
 o getSortingAlgorithm
 public SortingAlgorithm getSortingAlgorithm()
Returns:
the default SortingAlgorithm, viz. SortingAlgorithmImpl of JGL.
 o merge
 protected Genome merge(Genome parent[],
                        EvolutionParm parm) throws EvolutionException
Merge the parent genomes to produce a child genome.

Parameters:
parent - the parent genomes
Returns:
the new genome
 o getRandomGenerator
 public RandomGenerator getRandomGenerator()
Returns:
the RandomGenerator object used for this evolution.

All Packages  Class Hierarchy  This Package  Previous  Next  Index