Interface Individual<T extends Comparable<T>>

Type Parameters:
T - the type of the fitness value, must be comparable for selection and ranking purposes
All Known Implementing Classes:
ImmutableIndividual

@Immutable public interface Individual<T extends Comparable<T>>
Represents an individual in an evolutionary algorithm, consisting of a genotype and its associated fitness value.

This interface encapsulates the fundamental concept of an individual solution in evolutionary computation, combining genetic representation (genotype) with its evaluated performance (fitness).

  • Method Summary

    Modifier and Type
    Method
    Description
    Returns the fitness value of this individual.
    Returns the genotype of this individual.
    static <U extends Comparable<U>>
    Individual<U>
    of(Genotype genotype, U fitness)
    Creates a new individual with the specified genotype and fitness.
  • Method Details

    • genotype

      @Parameter Genotype genotype()
      Returns the genotype of this individual.
      Returns:
      the genetic representation containing chromosomes that define this individual's traits
    • fitness

      @Parameter T fitness()
      Returns the fitness value of this individual.
      Returns:
      the evaluated performance or quality measure of this individual's genotype
    • of

      static <U extends Comparable<U>> Individual<U> of(Genotype genotype, U fitness)
      Creates a new individual with the specified genotype and fitness.
      Type Parameters:
      U - the type of the fitness value
      Parameters:
      genotype - the genetic representation of the individual
      fitness - the evaluated fitness value of the individual
      Returns:
      a new Individual instance with the given genotype and fitness