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.


Variable Index

 o data
my genetic data
 o geneLength
the constant length of genes
 o theFac
the GeneFactory I am going to use

Constructor Index

 o ConstPackedGenomeStorage()

Method Index

 o geneLength()
 o getBits(int)
Get one of my genes.
 o getGene(int)
 o length()
 o newGeneIterator()
 o setGeneFactory(ConstPackableGeneFactory)
Tell me my GeneFactory
 o store(Gene[])
Store an array of genes.

Variables

 o data
 protected Code data
my genetic data

 o geneLength
 protected static int geneLength
the constant length of genes

 o theFac
 protected static ConstPackableGeneFactory theFac
the GeneFactory I am going to use

Constructors

 o ConstPackedGenomeStorage
 public ConstPackedGenomeStorage()

Methods

 o setGeneFactory
 public static void setGeneFactory(ConstPackableGeneFactory f) throws NoFactoryException
Tell me my GeneFactory

Throws: NoFactoryException
if the GeneFactory is nil
 o 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
 o length
 public int length()
Returns:
the number of genes I contain
 o newGeneIterator
 public ConstPackableGeneIterator newGeneIterator()
Returns:
a new ConstPackableGeneIterator positioned at my 1st gene
 o geneLength
 public int geneLength()
Returns:
the constant length of genes
 o 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.
 o 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