Package smile.gap

Interface Chromosome

All Superinterfaces:
Comparable<Chromosome>
All Known Subinterfaces:
LamarckianChromosome
All Known Implementing Classes:
BitString

public interface Chromosome extends Comparable<Chromosome>
Artificial chromosomes in genetic algorithm/programming encoding candidate solutions to an optimization problem. Note that chromosomes have to implement Comparable interface to support comparison of their fitness.
  • Method Summary

    Modifier and Type
    Method
    Description
    Returns a pair of offsprings by crossovering this one with another one according to the crossover rate, which determines how often will be crossover performed.
    double
    Returns the fitness of chromosome.
    void
    For genetic algorithms, this method mutates the chromosome randomly.
    Returns a new random instance.

    Methods inherited from interface java.lang.Comparable

    compareTo
  • Method Details

    • fitness

      double fitness()
      Returns the fitness of chromosome.
      Returns:
      the fitness of chromosome.
    • newInstance

      Chromosome newInstance()
      Returns a new random instance.
      Returns:
      a new random instance.
    • crossover

      Chromosome[] crossover(Chromosome other)
      Returns a pair of offsprings by crossovering this one with another one according to the crossover rate, which determines how often will be crossover performed. If there is no crossover, offspring is exact copy of parents. Various crossover strategies can be employed.
      Parameters:
      other - the other parent.
      Returns:
      a pair of offsprings.
    • mutate

      void mutate()
      For genetic algorithms, this method mutates the chromosome randomly. The offspring may have no changes since the mutation rate is usually very low. For Lamarckian algorithms, this method actually does the local search such as such as hill-climbing.