Interface Chromosome
- All Known Implementing Classes:
BitChromosome
,DoubleChromosome
,FloatChromosome
,IntChromosome
,NeatChromosome
,TreeChromosome
public interface Chromosome
Base interface for all chromosome types in the genetic algorithm framework.
A chromosome represents a single component of genetic information within a genotype. Different chromosome implementations encode genetic information in various formats such as bit strings, integer arrays, floating-point vectors, or tree structures.
This interface defines the minimal contract that all chromosome types must implement. Specific chromosome types extend this interface to provide type-specific operations and genetic operators.
- See Also:
-
Method Summary
Modifier and TypeMethodDescriptionint
Returns the number of alleles (genetic units) in this chromosome.
-
Method Details
-
getNumAlleles
int getNumAlleles()Returns the number of alleles (genetic units) in this chromosome.The interpretation of an allele depends on the specific chromosome type:
- For bit chromosomes: the number of bits
- For numeric chromosomes: the number of numeric values
- For tree chromosomes: the number of nodes in the tree
- Returns:
- the number of alleles in this chromosome, always positive
-