# SuanShu, a Java numerical and statistical library

com.numericalmethod.suanshu.optimization.multivariate.geneticalgorithm.minimizer.deoptim

## Class DEOptim

• All Implemented Interfaces:
Minimizer<OptimProblem,IterativeSolution<Vector>>, IterativeMinimizer<OptimProblem>, MultivariateMinimizer<OptimProblem,IterativeSolution<Vector>>, Optimizer<OptimProblem,IterativeSolution<Vector>>

public class DEOptim
extends SimpleGridMinimizer
Differential Evolution (DE) is a global optimization method. It is a genetic algorithm that iteratively tries to improve a candidate solution with regard to a given measure of quality. DE is used for multidimensional real-valued functions but does not use the gradient of the problem being optimized, which means DE does not require for the optimization problem to be differentiable as is required by classic optimization methods such as gradient descent and quasi-newton methods. DE can therefore also be used on optimization problems that are not even continuous, are noisy, change over time, etc. Comparing to other genetic algorithm optimization methods, the breakthrough of DE is the idea of using vector differences for perturbing the vector population.

The R equivalent function is DEoptim in package DEoptim.

• ### Nested Class Summary

Nested Classes
Modifier and Type Class and Description
static interface  DEOptim.NewCellFactory
This factory constructs a new DEOptimCellFactory for each minimization problem.
protected class  DEOptim.Solution
This is the solution to a minimization problem using DEOptim.
• ### Nested classes/interfaces inherited from class com.numericalmethod.suanshu.optimization.multivariate.geneticalgorithm.minimizer.simplegrid.SimpleGridMinimizer

SimpleGridMinimizer.NewCellFactoryCtor

• ### Fields inherited from class com.numericalmethod.suanshu.optimization.multivariate.geneticalgorithm.minimizer.simplegrid.SimpleGridMinimizer

DEFAULT_STABLE_ITERATION_COUNT, epsilon, factoryCtor, maxIterations, nStableIterations, uniform
• ### Constructor Summary

Constructors
Constructor and Description
DEOptim(DEOptim.NewCellFactory factoryCtor, RandomLongGenerator uniform, double epsilon, int maxIterations, int nStableIterations)
Construct a DEOptim to solve unconstrained minimization problems.
DEOptim(double Cr, double F, double epsilon, int maxIterations, int nStableIterations)
Construct a DEOptim to solve unconstrained minimization problems.
DEOptim(double Cr, double F, RandomLongGenerator uniform, double epsilon, int maxIterations, int nStableIterations)
Construct a DEOptim to solve unconstrained minimization problems.
• ### Method Summary

All Methods
Modifier and Type Method and Description
IterativeSolution<Vector> solve(OptimProblem problem)
Solve an optimization problem, e.g., OptimProblem.
• ### Methods inherited from class java.lang.Object

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

• #### DEOptim

public DEOptim(DEOptim.NewCellFactory factoryCtor,
RandomLongGenerator uniform,
double epsilon,
int maxIterations,
int nStableIterations)
Construct a DEOptim to solve unconstrained minimization problems.
Parameters:
factoryCtor - a factory that constructs a new instance of SimpleCellFactory for each problem
uniform - a uniform random number generator
epsilon - a precision parameter: when a number |x| ≤ ε, it is considered 0
maxIterations - the maximum number of iterations
nStableIterations - The solution is considered converged if the minimum does not change over this many iterations.
• #### DEOptim

public DEOptim(double Cr,
double F,
RandomLongGenerator uniform,
double epsilon,
int maxIterations,
int nStableIterations)
Construct a DEOptim to solve unconstrained minimization problems.
Parameters:
Cr - the crossover probability
F - the scaling factor
uniform - a uniform random number generator
epsilon - a precision parameter: when a number |x| ≤ ε, it is considered 0
maxIterations - the maximum number of iterations
nStableIterations - The solution is considered converged if the minimum does not change over this many iterations.
"Kenneth Price, Rainer M. Storn, Jouni A. Lampinen, "Section 2.1.8 Notation," Differential Evolution: A Practical Approach to Global Optimization, Springer, 2005."
• #### DEOptim

public DEOptim(double Cr,
double F,
double epsilon,
int maxIterations,
int nStableIterations)
Construct a DEOptim to solve unconstrained minimization problems.
Parameters:
Cr - the crossover probability
F - the scaling factor
epsilon - a precision parameter: when a number |x| ≤ ε, it is considered 0
maxIterations - the maximum number of iterations
nStableIterations - The solution is considered converged if the minimum does not change over this many iterations.
"Kenneth Price, Rainer M. Storn, Jouni A. Lampinen, "Section 2.1.8 Notation," Differential Evolution: A Practical Approach to Global Optimization, Springer, 2005."
• ### Method Detail

• #### solve

public IterativeSolution<Vector> solve(OptimProblem problem)
throws Exception
Description copied from interface: Optimizer
Solve an optimization problem, e.g., OptimProblem.
Specified by:
solve in interface Optimizer<OptimProblem,IterativeSolution<Vector>>
Overrides:
solve in class SimpleGridMinimizer
Parameters:
problem - an optimization problem
Returns:
a solution to the optimization problem
Throws:
Exception - when there is an error solving the problem