public interface Chromosome<G extends Gene<?,G>> extends Verifiable, Iterable<G>, Immutable, Factory<Chromosome<G>>, Serializable
Modifier and Type | Method and Description |
---|---|
G |
getGene()
Return the first gene of this chromosome.
|
G |
getGene(int index)
Return the gene on the specified index.
|
int |
length()
Returns the length of the Chromosome.
|
Chromosome<G> |
newInstance(ISeq<G> genes)
A factory method which creates a new
Chromosome of specific type
and the given genes . |
ISeq<G> |
toSeq()
Return an unmodifiable sequence of the genes of this chromosome.
|
isValid
newInstance
Chromosome<G> newInstance(ISeq<G> genes)
Chromosome
of specific type
and the given genes
.genes
- the genes of the new chromosome. The given genes array is
not copied.Chromosome
of the same type with the given genes.NullPointerException
- if the given gene
s are null
.G getGene()
G getGene(int index)
index
- The gene index.IndexOutOfBoundsException
- if the index is out of range
(index < 1 || index >= length()).int length()
© 2007-2014 Franz Wilhelmstötter (2014-03-07 19:35)