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 GeneSelection
s of allowed gene types
(usually one selection per Chromosome ID). The gene
selections are programmatically initialised via
#setGeneSelection
.
- Author:
- Steve Meyfroidt
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
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)
Copyright © 2002 the Art Of Life team. All Rights Reserved.