Class AbstractListChromosome<T>

    • Constructor Detail

      • AbstractListChromosome

        public AbstractListChromosome​(List<T> representation)
        Constructor.
        Parameters:
        representation - inner representation of the chromosome
      • AbstractListChromosome

        public AbstractListChromosome​(T[] representation)
        Constructor.
        Parameters:
        representation - inner representation of the chromosome
    • Method Detail

      • getLength

        public int getLength()
        Returns the length of the chromosome.
        Returns:
        the length of the chromosome
      • newFixedLengthChromosome

        public abstract AbstractListChromosome<T> newFixedLengthChromosome​(List<T> chromosomeRepresentation)
        Creates a new instance of the same class as 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.
        Parameters:
        chromosomeRepresentation - the inner array representation of the new chromosome.
        Returns:
        new instance extended from FixedLengthChromosome with the given arrayRepresentation