Class EvolutionaryAlgorithm

  • All Implemented Interfaces:
    org.opt4j.core.optimizer.IterativeOptimizer

    public class EvolutionaryAlgorithm
    extends java.lang.Object
    implements org.opt4j.core.optimizer.IterativeOptimizer
    The EvolutionaryAlgorithm is an implementation of an Evolutionary Algorithm based on the operators Crossover and Mutate. It uses a Selector for the mating and environmental selection.
    • Constructor Summary

      Constructors 
      Constructor Description
      EvolutionaryAlgorithm​(org.opt4j.core.optimizer.Population population, org.opt4j.core.IndividualFactory individualFactory, org.opt4j.core.optimizer.IndividualCompleter completer, Selector selector, Mating mating, int alpha, int mu, int lambda)
      Constructs an EvolutionaryAlgorithm with a Population, an IndividualFactory, a IndividualCompleter, a Selector, a Mating, the number of generations, the population size, the number of parents, the number of offspring, and a random number generator.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void initialize()  
      void next()  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • alpha

        protected final int alpha
      • lambda

        protected final int lambda
      • mu

        protected final int mu
      • selector

        protected final Selector selector
      • mating

        protected final Mating mating
    • Constructor Detail

      • EvolutionaryAlgorithm

        @Inject
        public EvolutionaryAlgorithm​(org.opt4j.core.optimizer.Population population,
                                     org.opt4j.core.IndividualFactory individualFactory,
                                     org.opt4j.core.optimizer.IndividualCompleter completer,
                                     Selector selector,
                                     Mating mating,
                                     int alpha,
                                     int mu,
                                     int lambda)
        Constructs an EvolutionaryAlgorithm with a Population, an IndividualFactory, a IndividualCompleter, a Selector, a Mating, the number of generations, the population size, the number of parents, the number of offspring, and a random number generator.
        Parameters:
        population - the population
        individualFactory - the individual factory
        completer - the completer
        selector - the selector
        mating - the mating
        alpha - the population size
        mu - the number of parents
        lambda - the number of offspring
    • Method Detail

      • initialize

        public void initialize()
        Specified by:
        initialize in interface org.opt4j.core.optimizer.IterativeOptimizer
      • next

        public void next()
                  throws org.opt4j.core.optimizer.TerminationException
        Specified by:
        next in interface org.opt4j.core.optimizer.IterativeOptimizer
        Throws:
        org.opt4j.core.optimizer.TerminationException