Package net.bmahe.genetics4j.core
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
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 TypeMethodDescriptionfitness()
Returns the fitness value of this individual.genotype()
Returns the genotype of this individual.static <U extends Comparable<U>>
Individual<U> Creates a new individual with the specified genotype and fitness.
-
Method Details
-
genotype
Returns the genotype of this individual.- Returns:
- the genetic representation containing chromosomes that define this individual's traits
-
fitness
Returns the fitness value of this individual.- Returns:
- the evaluated performance or quality measure of this individual's genotype
-
of
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 individualfitness
- the evaluated fitness value of the individual- Returns:
- a new Individual instance with the given genotype and fitness
-