Individuals
Class GEChromosome

java.lang.Object
  extended by Util.Structures.StaticIntList
      extended by Individuals.GEChromosome
All Implemented Interfaces:
Chromosome, IntList

public class GEChromosome
extends StaticIntList
implements Chromosome

Fixed length linear integer chromosome. This class is built on the static int list class from the the util package. A fast static list structure with dynamic size.


Field Summary
 
Fields inherited from class Util.Structures.StaticIntList
currentSize, data, initialSize, maxSize
 
Constructor Summary
GEChromosome()
           
GEChromosome(GEChromosome c)
          Copy constructor
GEChromosome(int size)
           
GEChromosome(int size, int[] data)
           
 
Method Summary
 void doubleSize()
          Double the size of the data ????
 int getCodonSize()
           
 int getCodonSizeBits()
           
static int getDefaultLength()
          get the default length
 int getLength()
          Returns the length of the genotype.
 int getMaxChromosomeLength()
           
 int getMaxCodonValue()
          Maximum value of a codon
 int getUsedGenes()
          Get how many genes where used when mapping
 int getUsedWraps()
          Get how many wraps were used
 boolean getValid()
          Returns the current valid field.
static void setDefaultLength(int length)
          Set the default length
 void setMaxChromosomeLength(int maxChromosomeLength)
           
 void setMaxCodonValue(int maxCodonValue)
          Set maximum codon value.
 void setUsedGenes(int usedGenes)
          Set how many genes where used during mapping
 void setUsedWraps(int usedWraps)
          Set how many wraps that where used
 void setValid(boolean newValid)
          Set a new value for the valid field.
 java.lang.String toString()
           
 
Methods inherited from class Util.Structures.StaticIntList
add, allocationSize, clear, get, getMaxSize, iterator, main, set, setAll, setMaxSize, size, toArray
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

GEChromosome

public GEChromosome()

GEChromosome

public GEChromosome(int size)

GEChromosome

public GEChromosome(int size,
                    int[] data)

GEChromosome

public GEChromosome(GEChromosome c)
Copy constructor

Parameters:
c - copy
Method Detail

getCodonSizeBits

public int getCodonSizeBits()

getMaxChromosomeLength

public int getMaxChromosomeLength()

setMaxChromosomeLength

public void setMaxChromosomeLength(int maxChromosomeLength)

setUsedWraps

public void setUsedWraps(int usedWraps)
Set how many wraps that where used

Parameters:
usedWraps - number of wraps used

getUsedWraps

public int getUsedWraps()
Get how many wraps were used

Returns:
number of wraps used

getUsedGenes

public int getUsedGenes()
Get how many genes where used when mapping

Returns:
number of genes used

setUsedGenes

public void setUsedGenes(int usedGenes)
Set how many genes where used during mapping

Parameters:
usedGenes - number of genes used

getMaxCodonValue

public int getMaxCodonValue()
Maximum value of a codon

Returns:
codon max value

getCodonSize

public int getCodonSize()

setMaxCodonValue

public void setMaxCodonValue(int maxCodonValue)
Set maximum codon value. Small values can bias the choices of production rules when applying mod to the codon value.

Parameters:
maxCodonValue - maximum codon value allowed

getLength

public int getLength()
Returns the length of the genotype.

Specified by:
getLength in interface Chromosome
Returns:
length

getValid

public boolean getValid()
Returns the current valid field.

Returns:
validity of the genotype

setValid

public void setValid(boolean newValid)
Set a new value for the valid field.

Parameters:
newValid - value for genotype validity

doubleSize

public void doubleSize()
Double the size of the data ???? This is already a feature of the staticIntList class.


setDefaultLength

public static void setDefaultLength(int length)
Set the default length

Parameters:
length - default length

getDefaultLength

public static int getDefaultLength()
get the default length

Returns:
default length

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object