The only constructor in this class. Sets the immutable configuration.
Parameters: a_configuration - the configuration to set throws: InvalidConfigurationException - if configuration is null author: Klaus Meffert since: 3.0
Creates and returns a copy of this object.
a clone of this instance throws: IllegalStateException - instead of CloneNotSupportedException author: Klaus Meffert since: 3.0
Taken from CompositeGene.
Parameters: a_geneClassName - name of the gene class Parameters: a_persistentRepresentation - persistent representation of the gene tocreate (could be obtained via getPersistentRepresentation) newly created gene throws: Exception - author: Klaus Meffert since: 3.2
0: Chromosome newly created in this generation. This means itdoes not need being crossed over with another newly created one author: Klaus Meffert since: 3.2
the configuration used author: Klaus Meffert since: 3.0
getGene
public synchronized Gene getGene(int a_desiredLocus)(Code)
Returns the Gene at the given index (locus) within the Chromosome. The
first gene is at index zero and the last gene is at the index equal to
the size of this Chromosome - 1.
Parameters: a_desiredLocus - index of the gene value to be returned Gene at the given index author: Neil Rotstan since: 1.0
Retrieves the set of genes that make up this Chromosome. This method
exists primarily for the benefit of GeneticOperators that require the
ability to manipulate Chromosomes at a low level.
an array of the Genes contained within this Chromosome author: Neil Rotstan since: 1.0
Returns a persistent representation of this chromosome, see interface Gene
for description. Similar to CompositeGene's routine. But does not include
all information of the chromosome (yet).
string representation of this Chromosome's relevant parts of itscurrent state throws: UnsupportedOperationException - author: Klaus Meffert since: 3.2
Resets the information of how many genetic operators have been performed
on the chromosome in the current round of evolution.
author: Klaus Meffert since: 3.2
setGene
public void setGene(int a_index, Gene a_gene)(Code)
Sets the genes for the chromosome.
Parameters: a_genes - the genes to set for the chromosome throws: InvalidConfigurationException - in case constraint checker isprovided author: Klaus Meffert since: 3.2 (previously in class Chromosome)
Counterpart of getPersistentRepresentation.
Parameters: a_representation - the string representation retrieved from a priorcall to the getPersistentRepresentation() method throws: UnsupportedRepresentationException - author: Klaus Meffert since: 3.2
Returns the size of this Chromosome (the number of genes it contains).
A Chromosome's size is constant and will not change, until setGenes(...)
is used.
number of genes contained within this Chromosome instance author: Neil Rotstan author: Klaus Meffert since: 1.0
Splits the input a_string into individual gene representations.
Taken and adapted from CompositeGene.
Parameters: a_string - the string to split the elements of the returned array are the persistentrepresentation strings of the chromosome's components throws: UnsupportedRepresentationException - author: Klaus Meffert since: 3.2