org.artoflife.gp.genome
Class GeneFactory

java.lang.Object
  |
  +--org.artoflife.gp.genome.GeneFactory

public class GeneFactory
extends java.lang.Object

Responsible for the creation of typed genes, choosing from GeneSelections of allowed gene types (usually one selection per Chromosome ID). The gene selections are programmatically initialised via #setGeneSelection.

Author:
Steve Meyfroidt

Method Summary
 GpTreeNode getGeneTree(java.lang.String id, java.lang.Class returnClass)
          Note that this recurses indefinitely if there are no leaf genes in the valid set.
protected  GpTreeNode getGeneTree(java.lang.String id, java.lang.Class returnClass, int depth)
           
static GeneFactory getInstance()
           
 void setGenes(java.lang.String id, GpTreeNode[] genes)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getInstance

public static GeneFactory getInstance()
Returns:
the singleton

setGenes

public void setGenes(java.lang.String id,
                     GpTreeNode[] genes)

getGeneTree

public GpTreeNode getGeneTree(java.lang.String id,
                              java.lang.Class returnClass)
Note that this recurses indefinitely if there are no leaf genes in the valid set.

Parameters:
id - of the set of allowed genes to use
Returns:
GpTreeNode root of a random tree that is not restricted to minimum depth.

getGeneTree

protected GpTreeNode getGeneTree(java.lang.String id,
                                 java.lang.Class returnClass,
                                 int depth)

artoflife pre0.1.0-dev

Copyright © 2002 the Art Of Life team. All Rights Reserved.