Interface ChromosomeSpec

All Known Implementing Classes:
BitChromosomeSpec, DoubleChromosomeSpec, FloatChromosomeSpec, ImmutableBitChromosomeSpec, ImmutableDoubleChromosomeSpec, ImmutableFloatChromosomeSpec, ImmutableIntChromosomeSpec, ImmutableNeatChromosomeSpec, ImmutableProgramTreeChromosomeSpec, IntChromosomeSpec, NeatChromosomeSpec, ProgramTreeChromosomeSpec

public interface ChromosomeSpec
Marker interface for chromosome specifications in evolutionary algorithms.

ChromosomeSpec defines the contract for specifying the structure, constraints, and properties of chromosomes used in genetic algorithms. Implementations provide the blueprint for creating chromosome instances with specific characteristics such as size, value ranges, and data types.

Chromosome specifications are used by:

  • Chromosome factories: To create chromosome instances with correct properties
  • Genetic operators: To understand chromosome structure for crossover and mutation
  • Validation logic: To ensure chromosome integrity and constraint satisfaction
  • Algorithm configuration: To specify the genetic representation for problems

The framework provides several concrete implementations:

Chromosome specifications typically define:

  • Size/Length: Number of alleles or genes in the chromosome
  • Value constraints: Valid ranges, domains, or sets of allowed values
  • Data type: The primitive or object type used for allele representation
  • Structural properties: Fixed vs. variable length, constraints between alleles

Example usage in genetic algorithm configuration:


 // Create a specification for 100-bit binary chromosome
 ChromosomeSpec bitSpec = BitChromosomeSpec.of(100);
 
 // Create a specification for integer chromosome with range [0, 50]
 ChromosomeSpec intSpec = IntChromosomeSpec.of(10, 0, 50);
 
 // Use in genotype specification
 GenotypeSpec genotypeSpec = GenotypeSpec.of(bitSpec, intSpec);
 
See Also: