T - type of the representation listpublic abstract class AbstractListChromosome<T> extends Chromosome
| Constructor and Description |
|---|
AbstractListChromosome(java.util.List<T> representation)
Constructor.
|
AbstractListChromosome(T[] representation)
Constructor.
|
| Modifier and Type | Method and Description |
|---|---|
int |
getLength()
Returns the length of the chromosome.
|
abstract AbstractListChromosome<T> |
newFixedLengthChromosome(java.util.List<T> chromosomeRepresentation)
Creates a new instance of the same class as
this is, with a
given arrayRepresentation. |
java.lang.String |
toString() |
compareTo, getFitness, searchForFitnessUpdatepublic AbstractListChromosome(java.util.List<T> representation)
representation - inner representation of the chromosomepublic AbstractListChromosome(T[] representation)
representation - inner representation of the chromosomepublic int getLength()
public abstract AbstractListChromosome<T> newFixedLengthChromosome(java.util.List<T> chromosomeRepresentation)
this is, with a
given arrayRepresentation. This is needed in crossover and
mutation operators, where we need a new instance of the same class, but
with different array representation.
Usually, this method just calls a constructor of the class.chromosomeRepresentation - the inner array representation of the new chromosome.public java.lang.String toString()
toString in class java.lang.ObjectCopyright © 2010 - 2023 Adobe. All Rights Reserved