public class NelderMeadONeill extends Optimizer
d(i)^T*d(i-1) < 0
holds where d(i) = (x(i)-x(i-1)).
This project was carried out at:
and supported byGenOpt Copyright (c) 1998-2021, The Regents of the University of California, through Lawrence Berkeley National Laboratory (subject to receipt of any required approvals from the U.S. Dept. of Energy). All rights reserved.
| Modifier and Type | Field and Description |
|---|---|
protected double |
cFactor
The step size factor for perturbation and reconstruction
|
protected int[] |
con
The kind of constraints
|
protected int |
dimX
The dimension of the problem
|
protected int |
dimXP1
The dimension of the problem plus 1
|
protected int |
konvge
A flag whether the convergence check is only allowed after 'konvge'
main iterations
|
protected double[] |
low
The lower bounds
|
protected boolean |
modStoCri
A flag whether the stopping criterion has to be modified or not
|
protected double |
sqEps
The required accuracy of the variance (eps*eps)
|
protected double[] |
upp
The upper bounds
|
protected Point[] |
x
The points
|
done, EXCLUDING, FS, INCLUDING, LS, MAINITERATION, ORIGINAL, SUBITERATION, TRANSFORMED| Constructor and Description |
|---|
NelderMeadONeill(GenOpt genOptData)
Constructor
|
| Modifier and Type | Method and Description |
|---|---|
protected int |
getBest()
Gets the number of the best point
|
protected int |
getWorst()
Gets the number of the worst point
|
protected double[] |
getXCenter(int worst)
Gets the center point for the reflection
|
protected int |
rank(double f)
Compares a trial with the other vertices
|
protected double[] |
reflect(double[] xCenter,
double[] xWorst)
Reflects a point
|
protected boolean |
restartCriterion()
Determines whether a restart with a smaller simplex should be tried or not
|
int |
run(Point x0)
Runs the optimization process until a termination criteria
is satisfied
|
algorithmRequiresUsageOfStepNumber, appendToOutputListing, checkMaxIteration, checkObjectiveFunctionValue, ensureOnlyContinuousParameters, ensureOnlyDiscreteParameters, getAbsAccuracyFunction, getDimensionContinuous, getDimensionDiscrete, getDimensionF, getDimensionX, getDiscreteValueDouble0, getDx, getDx0, getF, getF, getIndex0, getIndex0, getInputValueBoolean, getInputValueDouble, getInputValueDouble, getInputValueInteger, getInputValueInteger, getInputValueString, getInputValueString, getKindOfConstraint, getL, getLengthDiscrete, getMainIterationNumber, getMaximumThreadPoolSize, getMaxIterationNumber, getMinimumPoint, getMode, getObjectiveFunctionName, getOutputPath, getPointerToEqualPoints, getRelAccuracyFunction, getSimulationNumber, getStepNumber, getU, getVariableNameContinuous, getVariableNameDiscrete, getX0, getX0, goToEndOfCommandFile, increaseStepNumber, increaseStepNumber, isFeasible, isNextToken, maxIterationReached, mustStopOptimization, print, println, replace, report, reportCurrentLowestPoint, reportMinimum, resetStepNumber, roundCoordinates, run, setInfo, setMode, setNumberOfMatchingResults, setToFeasibleCoordinate, setToFeasibleCoordinate, setWarning, simulate, throwInputError, useStepNumber, writeStepNumberprotected Point[] x
protected double[] low
protected double[] upp
protected int[] con
protected int dimX
protected int dimXP1
protected double sqEps
protected int konvge
protected double cFactor
protected boolean modStoCri
public NelderMeadONeill(GenOpt genOptData) throws OptimizerException, java.io.IOException, java.lang.Exception, InputFormatException
genOptData - a reference to the GenOpt object.OptimizerException - if algorithm is used for problems
with less than 2 independent variablesjava.lang.Exception - if an exception occursjava.io.IOException - if an I/O exception occursInputFormatException - if an input format is wrongpublic int run(Point x0) throws OptimizerException, java.lang.Exception
run in class Optimizerx0 - initial point-1 if the maximum number of iteration
is exceeded
+1 if the required accuracy is reachedjava.lang.ExceptionOptimizerExceptionInputFormatException - if an InputFormatException occursjava.lang.NoSuchMethodException - if a method that should be invoked could not be foundjava.lang.IllegalAccessException - if an invoked method enforces Java language access
control and the underlying method is inaccessiblejava.lang.reflect.InvocationTargetException - if an invoked method throws an exceptionprotected boolean restartCriterion()
true if restart can be tried, false otherwiseprotected int getWorst()
protected int getBest()
protected double[] getXCenter(int worst)
worst - the index of the worst pointx = 1 / dimX(x) * sum(x(k,i), i = 0..dimX(x), i != worst)protected double[] reflect(double[] xCenter,
double[] xWorst)
xCenter - the center point for normal reflectionxWorst - the point that has to be reflectedxNew = 2 * xCenter - xWorstprotected int rank(double f)
f - the trial to be compared