Class ProgramTreeChromosomeFactory

java.lang.Object
net.bmahe.genetics4j.gp.chromosomes.factory.ProgramTreeChromosomeFactory
All Implemented Interfaces:
ChromosomeFactory<TreeChromosome<Operation<?>>>

public class ProgramTreeChromosomeFactory extends Object implements ChromosomeFactory<TreeChromosome<Operation<?>>>
  • Field Details Link icon

  • Constructor Details Link icon

    • ProgramTreeChromosomeFactory Link icon

      public ProgramTreeChromosomeFactory(ProgramGenerator _programGenerator)
  • Method Details Link icon

    • canHandle Link icon

      public boolean canHandle(ChromosomeSpec chromosomeSpec)
      Description copied from interface: ChromosomeFactory
      Validates if this factory is appropriate for generating a chromosome based on the specifications passed as a parameter
      Specified by:
      canHandle in interface ChromosomeFactory<TreeChromosome<Operation<?>>>
      Parameters:
      chromosomeSpec - Specifications of the chromosome we wish to generate
      Returns:
      true if the implementation can generate a chromosome based on the specifications
    • generate Link icon

      public TreeChromosome<Operation<?>> generate(ChromosomeSpec chromosomeSpec)
      Description copied from interface: ChromosomeFactory
      Generate a chromosome based on the specifications passed as a parameter
      Specified by:
      generate in interface ChromosomeFactory<TreeChromosome<Operation<?>>>
      Parameters:
      chromosomeSpec - Specifications of the chromosome we wish to generate
      Returns:
      Generated chromosome