public class NelderMeadSimplex extends AbstractSimplex
Modifier and Type | Field and Description |
---|---|
private static double |
DEFAULT_GAMMA
Default value for
gamma : 0.5. |
private static double |
DEFAULT_KHI
Default value for
khi : 2.0. |
private static double |
DEFAULT_RHO
Default value for
rho : 1.0. |
private static double |
DEFAULT_SIGMA
Default value for
sigma : 0.5. |
private double |
gamma
Contraction coefficient.
|
private double |
khi
Expansion coefficient.
|
private double |
rho
Reflection coefficient.
|
private double |
sigma
Shrinkage coefficient.
|
Constructor and Description |
---|
NelderMeadSimplex(double[] steps)
Build a Nelder-Mead simplex with default coefficients.
|
NelderMeadSimplex(double[][] referenceSimplex)
Build a Nelder-Mead simplex with default coefficients.
|
NelderMeadSimplex(double[][] referenceSimplex,
double rho,
double khi,
double gamma,
double sigma)
Build a Nelder-Mead simplex with specified coefficients.
|
NelderMeadSimplex(double[] steps,
double rho,
double khi,
double gamma,
double sigma)
Build a Nelder-Mead simplex with specified coefficients.
|
NelderMeadSimplex(int n)
Build a Nelder-Mead simplex with default coefficients.
|
NelderMeadSimplex(int n,
double sideLength)
Build a Nelder-Mead simplex with default coefficients.
|
NelderMeadSimplex(int n,
double rho,
double khi,
double gamma,
double sigma)
Build a Nelder-Mead simplex with specified coefficients.
|
NelderMeadSimplex(int n,
double sideLength,
double rho,
double khi,
double gamma,
double sigma)
Build a Nelder-Mead simplex with specified coefficients.
|
Modifier and Type | Method and Description |
---|---|
void |
iterate(MultivariateFunction evaluationFunction,
java.util.Comparator<PointValuePair> comparator)
Compute the next simplex of the algorithm.
|
build, evaluate, getDimension, getPoint, getPoints, getSize, replaceWorstPoint, setPoint, setPoints
private static final double DEFAULT_RHO
rho
: 1.0.private static final double DEFAULT_KHI
khi
: 2.0.private static final double DEFAULT_GAMMA
gamma
: 0.5.private static final double DEFAULT_SIGMA
sigma
: 0.5.private final double rho
private final double khi
private final double gamma
private final double sigma
public NelderMeadSimplex(int n)
n
- Dimension of the simplex.public NelderMeadSimplex(int n, double sideLength)
n
- Dimension of the simplex.sideLength
- Length of the sides of the default (hypercube)
simplex. See AbstractSimplex.AbstractSimplex(int,double)
.public NelderMeadSimplex(int n, double sideLength, double rho, double khi, double gamma, double sigma)
n
- Dimension of the simplex. See
AbstractSimplex.AbstractSimplex(int,double)
.sideLength
- Length of the sides of the default (hypercube)
simplex. See AbstractSimplex.AbstractSimplex(int,double)
.rho
- Reflection coefficient.khi
- Expansion coefficient.gamma
- Contraction coefficient.sigma
- Shrinkage coefficient.public NelderMeadSimplex(int n, double rho, double khi, double gamma, double sigma)
n
- Dimension of the simplex. See
AbstractSimplex.AbstractSimplex(int)
.rho
- Reflection coefficient.khi
- Expansion coefficient.gamma
- Contraction coefficient.sigma
- Shrinkage coefficient.public NelderMeadSimplex(double[] steps)
steps
- Steps along the canonical axes representing box edges.
They may be negative but not zero. Seepublic NelderMeadSimplex(double[] steps, double rho, double khi, double gamma, double sigma)
steps
- Steps along the canonical axes representing box edges.
They may be negative but not zero. See
AbstractSimplex.AbstractSimplex(double[])
.rho
- Reflection coefficient.khi
- Expansion coefficient.gamma
- Contraction coefficient.sigma
- Shrinkage coefficient.java.lang.IllegalArgumentException
- if one of the steps is zero.public NelderMeadSimplex(double[][] referenceSimplex)
referenceSimplex
- Reference simplex. See
AbstractSimplex.AbstractSimplex(double[][])
.public NelderMeadSimplex(double[][] referenceSimplex, double rho, double khi, double gamma, double sigma)
referenceSimplex
- Reference simplex. See
AbstractSimplex.AbstractSimplex(double[][])
.rho
- Reflection coefficient.khi
- Expansion coefficient.gamma
- Contraction coefficient.sigma
- Shrinkage coefficient.NotStrictlyPositiveException
- if the reference simplex does not contain at least one point.DimensionMismatchException
- if there is a dimension mismatch in the reference simplex.public void iterate(MultivariateFunction evaluationFunction, java.util.Comparator<PointValuePair> comparator)
iterate
in class AbstractSimplex
evaluationFunction
- Evaluation function.comparator
- Comparator to use to sort simplex vertices from best
to worst.Copyright (c) 2003-2016 Apache Software Foundation