org.apache.ignite.ml.util.genetic

## Class GeneticAlgorithm

- java.lang.Object
- - org.apache.ignite.ml.util.genetic.GeneticAlgorithm

-     public class GeneticAlgorithm
      extends Object

  This class is an entry point to use Genetic Algorithm to solve optimization problem.

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `GeneticAlgorithm(List<Double[]> paramSet)`

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `double[]` | `getTheBestSolution()` Returns the best chromosome's genes presented as double array.
    `void` | `run()` The main method for genetic algorithm.
    `void` | `runParallel(LearningEnvironment environment)` The main method for genetic algorithm.
    `GeneticAlgorithm` | `withAmountOfEliteChromosomes(int amountOfEliteChromosomes)`
    `GeneticAlgorithm` | `withAmountOfGenerations(int amountOfGenerations)`
    `GeneticAlgorithm` | `withCrossingoverProbability(double crossingoverProbability)`
    `GeneticAlgorithm` | `withCrossoverStgy(CrossoverStrategy crossoverStgy)`
    `GeneticAlgorithm` | `withFitnessFunction(Function<Chromosome,Double> fitnessFunction)` Sets the custom fitness function.
    `GeneticAlgorithm` | `withMutationOperator(BiFunction<Integer,Double,Double> mutationOperator)`
    `GeneticAlgorithm` | `withMutationProbability(double mutationProbability)`
    `GeneticAlgorithm` | `withPopulationSize(int populationSize)`
    `GeneticAlgorithm` | `withSelectionStgy(SelectionStrategy selectionStgy)`

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Constructor Detail

    - #### GeneticAlgorithm

          public GeneticAlgorithm(List<Double[]> paramSet)

      Parameters:
        `paramSet` - The list of sets of parameter's values.

  - ### Method Detail

    - #### run

          public void run()

      The main method for genetic algorithm.

    - #### runParallel

          public void runParallel(LearningEnvironment environment)

      The main method for genetic algorithm.
      Parameters:
        `environment` - The environment.

    - #### withFitnessFunction

          public GeneticAlgorithm withFitnessFunction(Function<Chromosome,Double> fitnessFunction)

      Sets the custom fitness function.
      Parameters:
        `fitnessFunction` - Fitness function.

    - #### getTheBestSolution

          public double[] getTheBestSolution()

      Returns the best chromosome's genes presented as double array.

    - #### withAmountOfEliteChromosomes

          public GeneticAlgorithm withAmountOfEliteChromosomes(int amountOfEliteChromosomes)

      Parameters:
        `amountOfEliteChromosomes` - Amount of elite chromosomes.

    - #### withAmountOfGenerations

          public GeneticAlgorithm withAmountOfGenerations(int amountOfGenerations)

      Parameters:
        `amountOfGenerations` - Amount of generations.

    - #### withMutationOperator

          public GeneticAlgorithm withMutationOperator(BiFunction<Integer,Double,Double> mutationOperator)

      Parameters:
        `mutationOperator` - Mutation operator.

    - #### withPopulationSize

          public GeneticAlgorithm withPopulationSize(int populationSize)

      Parameters:
        `populationSize` - Population size.

    - #### withCrossingoverProbability

          public GeneticAlgorithm withCrossingoverProbability(double crossingoverProbability)

      Parameters:
        `crossingoverProbability` - Crossingover probability.

    - #### withMutationProbability

          public GeneticAlgorithm withMutationProbability(double mutationProbability)

      Parameters:
        `mutationProbability` - Mutation probability.

    - #### withCrossoverStgy

          public GeneticAlgorithm withCrossoverStgy(CrossoverStrategy crossoverStgy)

      Parameters:
        `crossoverStgy` - Crossover strategy.

    - #### withSelectionStgy

          public GeneticAlgorithm withSelectionStgy(SelectionStrategy selectionStgy)

      Parameters:
        `selectionStgy` - Selection strategy.

2022 Copyright © Apache Software Foundation
| Follow @ApacheIgnite
Ignite Database and Caching Platform | : ver. 2.13.0
Release Date | : April 20 2022