|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectgenopt.algorithm.Optimizer
genopt.algorithm.NelderMeadONeill
public class NelderMeadONeill
Class for minimizing a function using the Simplex algorithm
of Nelder and Mead with an extension by O'Neill.
The restart criterion can be modified (optimality condition is then
only checked if we have just a partial inside contraction or a
total contraction done and if 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-2011, 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.
| Field Summary | |
|---|---|
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 |
| Fields inherited from class genopt.algorithm.Optimizer |
|---|
done, EXCLUDING, FS, INCLUDING, LS, MAINITERATION, ORIGINAL, SUBITERATION, TRANSFORMED |
| Constructor Summary | |
|---|---|
NelderMeadONeill(GenOpt genOptData)
Constructor |
|
| Method Summary | |
|---|---|
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 |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected 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
| Constructor Detail |
|---|
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 variables
java.lang.Exception - if an exception occurs
java.io.IOException - if an I/O exception occurs
InputFormatException - if an input format is wrong| Method Detail |
|---|
public 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 reached
java.lang.Exception
OptimizerException
InputFormatException - if an InputFormatException occurs
java.lang.NoSuchMethodException - if a method that should be invoked could not be found
java.lang.IllegalAccessException - if an invoked method enforces Java language access
control and the underlying method is inaccessible
java.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 point
x = 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 reflected
xNew = 2 * xCenter - xWorstprotected int rank(double f)
f - the trial to be compared
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||