All Packages Class Hierarchy This Package Previous Next Index
Class evolution.pack.cons.ConstPackedGenomeStorage
java.lang.Object
|
+----evolution.pack.cons.ConstPackedGenomeStorage
- public class ConstPackedGenomeStorage
- extends Object
- implements PackedGenomeStorage, RandomAccessGenomeStorage
Implementation of packed random access genome storage based on Code
.
-
data
- my genetic data
-
geneLength
- the constant length of genes
-
theFac
- the
GeneFactory
I am going to use
-
ConstPackedGenomeStorage()
-
-
geneLength()
-
-
getBits(int)
- Get one of my genes.
-
getGene(int)
-
-
length()
-
-
newGeneIterator()
-
-
setGeneFactory(ConstPackableGeneFactory)
- Tell me my
GeneFactory
-
store(Gene[])
- Store an array of genes.
data
protected Code data
- my genetic data
geneLength
protected static int geneLength
- the constant length of genes
theFac
protected static ConstPackableGeneFactory theFac
- the
GeneFactory
I am going to use
ConstPackedGenomeStorage
public ConstPackedGenomeStorage()
setGeneFactory
public static void setGeneFactory(ConstPackableGeneFactory f) throws NoFactoryException
- Tell me my
GeneFactory
- Throws: NoFactoryException
- if the
GeneFactory
is nil
getGene
public Gene getGene(int i) throws EvolutionException
- Parameters:
- i - the index of the gene
- Returns:
- the i-th of my genes
- Throws: NoFactoryException
- if my
GeneFactory
is nil
length
public int length()
- Returns:
- the number of genes I contain
newGeneIterator
public ConstPackableGeneIterator newGeneIterator()
- Returns:
- a new
ConstPackableGeneIterator
positioned
at my 1st gene
geneLength
public int geneLength()
- Returns:
- the constant length of genes
getBits
public Code getBits(int n) throws NilException
- Get one of my genes.
Optimized access through the bit position rather than the index of the gene.
- Returns:
- the indicated gene as a
Code
, nil if my data is nil.
store
public void store(Gene g[]) throws EvolutionException
- Store an array of genes.
- Throws: EvolutionException
- if the argument is nil
All Packages Class Hierarchy This Package Previous Next Index