Class DifferentialEvolution

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

    public class DifferentialEvolution
    extends java.lang.Object
    implements org.opt4j.core.optimizer.IterativeOptimizer
    • Field Summary

      Fields 
      Modifier and Type Field Description
      protected org.opt4j.operators.algebra.Algebra<org.opt4j.core.Genotype> algebra  
      protected int alpha  
      protected org.opt4j.operators.crossover.Crossover<org.opt4j.core.Genotype> crossover  
      protected java.util.Random random  
      protected double scalingFactor  
      protected Selector selector  
    • Constructor Summary

      Constructors 
      Constructor Description
      DifferentialEvolution​(org.opt4j.core.optimizer.Population population, org.opt4j.core.IndividualFactory individualFactory, org.opt4j.core.optimizer.IndividualCompleter completer, org.opt4j.operators.algebra.Algebra<org.opt4j.core.Genotype> algebra, Selector selector, org.opt4j.core.common.random.Rand random, org.opt4j.operators.crossover.Crossover<org.opt4j.core.Genotype> crossover, int alpha, double scalingFactor)
      Constructs a DifferentialEvolution.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      protected org.opt4j.core.Individual createOffspring​(org.opt4j.core.Individual parent, java.util.List<org.opt4j.core.Individual> individuals, org.opt4j.operators.algebra.Term term)  
      protected DifferentialEvolution.Triple getTriple​(org.opt4j.core.Individual parent, java.util.List<org.opt4j.core.Individual> individuals)
      Returns three different Individuals from the individuals list.
      void initialize()  
      void next()  
      • Methods inherited from class java.lang.Object

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

      • scalingFactor

        protected final double scalingFactor
      • alpha

        protected final int alpha
      • algebra

        protected final org.opt4j.operators.algebra.Algebra<org.opt4j.core.Genotype> algebra
      • crossover

        protected final org.opt4j.operators.crossover.Crossover<org.opt4j.core.Genotype> crossover
      • selector

        protected final Selector selector
      • random

        protected final java.util.Random random
    • Constructor Detail

      • DifferentialEvolution

        @Inject
        public DifferentialEvolution​(org.opt4j.core.optimizer.Population population,
                                     org.opt4j.core.IndividualFactory individualFactory,
                                     org.opt4j.core.optimizer.IndividualCompleter completer,
                                     org.opt4j.operators.algebra.Algebra<org.opt4j.core.Genotype> algebra,
                                     Selector selector,
                                     org.opt4j.core.common.random.Rand random,
                                     org.opt4j.operators.crossover.Crossover<org.opt4j.core.Genotype> crossover,
                                     int alpha,
                                     double scalingFactor)
        Constructs a DifferentialEvolution.
        Parameters:
        population - the population
        individualFactory - the individual factory
        completer - the completer
        algebra - the algebra operator
        selector - the selector
        random - the random number generator
        crossover - the crossover operator
        alpha - the population size
        scalingFactor - the scaling factor F
    • 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
      • createOffspring

        protected org.opt4j.core.Individual createOffspring​(org.opt4j.core.Individual parent,
                                                            java.util.List<org.opt4j.core.Individual> individuals,
                                                            org.opt4j.operators.algebra.Term term)
      • getTriple

        protected DifferentialEvolution.Triple getTriple​(org.opt4j.core.Individual parent,
                                                         java.util.List<org.opt4j.core.Individual> individuals)
        Returns three different Individuals from the individuals list. Each Individual is not equal to the parent.
        Parameters:
        parent - the parent Individual
        individuals - the population
        Returns:
        the three individuals as a Triple