class NelderMeadSimplex extends Minimizer with Error
The NelderMeadSimplex
solves Non-Linear Programming (NLP) problems using
the Nelder-Mead Simplex algorithm. Given a function 'f' and its dimension
'n', the algorithm moves a simplex defined by n + 1 points in order to find
an optimal solution. The algorithm is derivative-free.
minimize f(x)
- Alphabetic
- By Inheritance
- NelderMeadSimplex
- Error
- Minimizer
- AnyRef
- Any
- Hide All
- Show All
- Public
- All
Instance Constructors
-
new
NelderMeadSimplex(f: FunctionV2S, n: Int)
- f
the vector-to-scalar objective function
- n
the dimension of the search space
Type Members
Value Members
-
final
def
!=(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
final
def
##(): Int
- Definition Classes
- AnyRef → Any
-
final
def
==(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
val
EPSILON: Double
- Attributes
- protected
- Definition Classes
- Minimizer
-
val
MAX_ITER: Int
- Attributes
- protected
- Definition Classes
- Minimizer
-
val
STEP: Double
- Attributes
- protected
- Definition Classes
- Minimizer
-
val
TOL: Double
- Attributes
- protected
- Definition Classes
- Minimizer
-
final
def
asInstanceOf[T0]: T0
- Definition Classes
- Any
-
def
centroid(): Vertex
Calculate the centroid of the best-side of the simplex (excluding h=0), returning it and its functional value.
-
def
clone(): AnyRef
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws( ... ) @native() @HotSpotIntrinsicCandidate()
-
def
contractIn(x_c: VectorD, x_r: VectorD): Vertex
Contract: compute the inner contraction point between x_h and x_c.
Contract: compute the inner contraction point between x_h and x_c.
- x_c
the best-side centroid of the simplex
- x_r
the reflection point
-
def
contractOut(x_c: VectorD, x_r: VectorD): Vertex
Contract: compute the outer contraction point between x_r and x_c.
Contract: compute the outer contraction point between x_r and x_c.
- x_c
the best-side centroid of the simplex
- x_r
the reflection point
-
final
def
eq(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
-
def
equals(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
def
expand(x_c: VectorD, x_r: VectorD): Vertex
Expand: compute the expansion point beyond the reflection point.
Expand: compute the expansion point beyond the reflection point.
- x_c
the best-side centroid of the simplex
- x_r
the reflection point
-
def
fg(x: VectorD): Double
The objective function 'f' plus a weighted penalty based on the constraint function 'g'.
The objective function 'f' plus a weighted penalty based on the constraint function 'g'. Override for constrained optimization and ignore for unconstrained optimization.
- x
the coordinate values of the current point
- Definition Classes
- Minimizer
-
final
def
flaw(method: String, message: String): Unit
- Definition Classes
- Error
-
final
def
getClass(): Class[_]
- Definition Classes
- AnyRef → Any
- Annotations
- @native() @HotSpotIntrinsicCandidate()
-
def
hashCode(): Int
- Definition Classes
- AnyRef → Any
- Annotations
- @native() @HotSpotIntrinsicCandidate()
-
def
improveSimplex(toler: Double = EPSILON): (Double, Double)
Improve the simplex by replacing the worst/highest vertex (x_h) with a a better one found on the line containing x_h and the centroid (x_c).
Improve the simplex by replacing the worst/highest vertex (x_h) with a a better one found on the line containing x_h and the centroid (x_c). Try the reflection, expansion, outer contraction and inner contraction points, in that order. If none succeeds, shrink the simplex and iterate. Return both distance and difference between x_h (worst) and x_l (best).
- toler
the tolerance used for termination
-
def
initSimplex(x0: VectorD, step: Double): Unit
Initialize the search simplex by setting n + 1 vertices and computing their functional values.
Initialize the search simplex by setting n + 1 vertices and computing their functional values.
- x0
the given starting point
- step
the step size
-
final
def
isInstanceOf[T0]: Boolean
- Definition Classes
- Any
-
def
lineSearch(x: VectorD, dir: VectorD, step: Double = STEP): Double
Perform an exact (e.g.,
GoldenSectionLS
) or inexact (e.g.,WolfeLS
) line search.Perform an exact (e.g.,
GoldenSectionLS
) or inexact (e.g.,WolfeLS
) line search. Search in direction 'dir', returning the distance 'z' to move in that direction. Currently NOT USED, but may be used to find a better point to add to simplex.- x
the current point
- dir
the direction to move in
- step
the initial step size
- Definition Classes
- NelderMeadSimplex → Minimizer
-
final
def
ne(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
-
final
def
notify(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native() @HotSpotIntrinsicCandidate()
-
final
def
notifyAll(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native() @HotSpotIntrinsicCandidate()
-
def
reflect(x_c: VectorD): Vertex
Reflect: compute the reflection point of the worst point (h=0) across the centroid.
Reflect: compute the reflection point of the worst point (h=0) across the centroid.
- x_c
the best-side centroid of the simplex
-
def
replace(x_n: VectorD): Unit
Replace the worst vertex (h=0) in the simplex with the new point.
Replace the worst vertex (h=0) in the simplex with the new point.
- x_n
the new replacement point
-
def
shrink(): Unit
Shrink: fixing the best/lowest point (l=n), move the rest of the points toward it.
-
def
solve(x0: VectorD, step: Double = STEP, toler: Double = EPSILON): VectorD
Solve the Non-Linear Programming (NLP) problem using the Nelder-Mead Simplex algorithm.
Solve the Non-Linear Programming (NLP) problem using the Nelder-Mead Simplex algorithm.
- x0
the given starting point
- step
the initial step size
- toler
the tolerance used for termination
- Definition Classes
- NelderMeadSimplex → Minimizer
-
def
sort(): Unit
Sort the vertices in non-increasing order (high to low).
Sort the vertices in non-increasing order (high to low). Then the key indices are worst/highest (h=0), second worst (s=1), and best/lowest (l=n).
-
final
def
synchronized[T0](arg0: ⇒ T0): T0
- Definition Classes
- AnyRef
-
def
toString(): String
- Definition Classes
- AnyRef → Any
-
final
def
wait(arg0: Long, arg1: Int): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )
-
final
def
wait(arg0: Long): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... ) @native()
-
final
def
wait(): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )
Deprecated Value Members
-
def
finalize(): Unit
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws( classOf[java.lang.Throwable] ) @Deprecated
- Deprecated