Class GeneticAlgorithm<H>

  • Type Parameters:
    H - The hypothesis class to use.

    public class GeneticAlgorithm<H>
    extends Object
    Central entry class for generic algorithm implementations. There are two approaches you can take:
    1. High-level approach: Call the of the findMaximum() method. It will iterate multiple generations until the finish-condition is met.
    2. Low-Level approach: Iterate yourself and calculate each generation yourself using the calculateNextGeneration(List) method. This way you can do your own analysis on the state of the population.
    Author:
    Stephan Fuhrmann
    • Method Detail

      • calculateNextGeneration

        public List<H> calculateNextGeneration​(List<H> currentGeneration)
        Calculate one generation step. Takes a current generation and calculates the next generation out of it.
        Parameters:
        currentGeneration - the current generation of hypothesis handles.
        Returns:
        the population of the next generation. This will contain some individuals from the currentGeneration input.
        Since:
        3.0.0