T
- type of the representation listpublic abstract class AbstractListChromosome<T> extends Chromosome
Constructor and Description |
---|
AbstractListChromosome(List<T> representation)
Constructor, copying the input representation.
|
AbstractListChromosome(List<T> representation,
boolean copyList)
Constructor.
|
AbstractListChromosome(T[] representation)
Constructor, copying the input representation.
|
Modifier and Type | Method and Description |
---|---|
int |
getLength()
Returns the length of the chromosome.
|
abstract AbstractListChromosome<T> |
newFixedLengthChromosome(List<T> chromosomeRepresentation)
Creates a new instance of the same class as
this is, with a given arrayRepresentation . |
String |
toString() |
compareTo, getFitness, searchForFitnessUpdate
public AbstractListChromosome(List<T> representation) throws InvalidRepresentationException
representation
- inner representation of the chromosomeInvalidRepresentationException
- iff the representation
can not represent a valid chromosomepublic AbstractListChromosome(T[] representation) throws InvalidRepresentationException
representation
- inner representation of the chromosomeInvalidRepresentationException
- iff the representation
can not represent a valid chromosomepublic int getLength()
public abstract AbstractListChromosome<T> newFixedLengthChromosome(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.Jas4pp 1.5 © Java Analysis Studio for Particle Physics