GridSearch

scalation.optimization.GridSearch
See theGridSearch companion object
class GridSearch(f: FunctionV2S, n: Int, g: FunctionV2S, nSteps: Int) extends Minimizer

The GridSearch class performs grid search over an n-dimensional space to find a minimal objective value for f(x).

Value parameters

f

the objective function to be minimized

g

the constraint function to be satisfied, if any

n

the number of dimensions in search space

nSteps

the number of steps an axes is divided into to from the grid

Attributes

Companion
object
Graph
Supertypes
trait Minimizer
class Object
trait Matchable
class Any

Members list

Value members

Concrete methods

def lineSearch(x: VectorD, dir: VectorD, step: Double): Double

The lineserarch method is not used.

The lineserarch method is not used.

Attributes

def setAxes(minAx: VectorD, maxAx: VectorD): Unit

Create the n axes for the grid. Must be called before the solve method.

Create the n axes for the grid. Must be called before the solve method.

Value parameters

MaxAx

the maximum value along each axes (e.g., [10.0, 5.0]

minAx

the minimum value along each axes (e.g., [-5.0, 0.0]

Attributes

def solve(x0: VectorD, step: Double, toler: Double): FuncVec

Solve the Non-Linear Programming (NLP) problem using grid search. Return the optimal point/vector x and its objective function value.

Solve the Non-Linear Programming (NLP) problem using grid search. Return the optimal point/vector x and its objective function value.

Value parameters

step

the initial step size

toler

the tolerance

x0

the starting point

Attributes

Inherited methods

def fg(x: VectorD): Double

The objective function f plus a weighted penalty based on the constraint function g. Override for constrained optimization and ignore for unconstrained optimization.

The objective function f plus a weighted penalty based on the constraint function g. Override for constrained optimization and ignore for unconstrained optimization.

Value parameters

x

the coordinate values of the current point

Attributes

Inherited from:
Minimizer
def resolve(n: Int, step_: Double, toler: Double): FuncVec

Solve the following Non-Linear Programming (NLP) problem: min { f(x) | g(x) <= 0 }. To use explicit functions for gradient, replace gradient (fg, x._1 + s) with gradientD (df, x._1 + s). This method uses multiple random restarts.

Solve the following Non-Linear Programming (NLP) problem: min { f(x) | g(x) <= 0 }. To use explicit functions for gradient, replace gradient (fg, x._1 + s) with gradientD (df, x._1 + s). This method uses multiple random restarts.

Value parameters

n

the dimensionality of the search space

step_

the initial step size

toler

the tolerance

Attributes

Inherited from:
Minimizer