Reference

This is the class and function reference of pydirect. Please refer to the tutorial for further details, as the class and function raw specifications may not be enough to give full guidelines on their uses.

DIRECT.solve(objective, l, u, eps=0.0001, maxf=20000, maxT=6000, algmethod=0, fglobal=-1e+100, fglper=0.01, volper=-1.0, sigmaper=-1.0, logfilename='DIRresults.txt', user_data=None)[source]

Solve an optimization problem using the DIRECT (Dividing Rectangles) algorithm. It can be used to solve general nonlinear programming problems of the form:

\min_ {x \in R^n} f(x)

subject to

x_L \leq  x  \leq x_U

Where x are the optimization variables (with upper an lower bounds), f(x) is the objective function.

Parameters :

objective : function pointer

Callback function for evaluating objective function. The callback functions accepts two parameters: x (value of the optimization variables at which the objective is to be evaluated) and user_data, an arbitrary data object supplied by the user. The function should return a tuple of two values: the objective function value at the point x and a value (flag) that is set to 1 if the function is not defined at point x (0 if it is defined).

l : array-like, shape = [n]

Lower bounds on variables, where n is the dimension of x.

u : array-like, shape = [n]

Upper bounds on variables, where n is the dimension of x.

eps : float, optional (default=1e-4)

Ensures sufficient decrease in function value when a new potentially optimal interval is chosen.

maxf : integer, optional (default=20000)

Approximate upper bound on objective function evaluations.

Note

Maximal allowed value is 90000 see documentation of fotran library.

maxT : integer, optional (default=6000)

Maximum number of iterations.

Note

Maximal allowed value is 6000 see documentation of fotran library.

algmethod : integer

Whether to use the original or modified DIRECT algorithm. Possible values:

  • algmethod=0 - use the original DIRECT algorithm
  • algmethod=1 - use the modified DIRECT-l algorithm

fglobal : float, optional (default=-1e100)

Function value of the global optimum. If this value is not known set this to a very large negative value.

fglper : float, optional (default 0.01)

Terminate the optimization when the percent error satisfies:

100*(f_{min} - f_{global})/\max(1, |f_{global}|) \leq f_{glper}

volper : float, optional (default=-1.0)

Terminate the optimization once the volume of a hyperrectangle is less than volper percent of the original hyperrectangel.

sigmaper : float, optional (default=-1.0)

Terminate the optimization once the measure of the hyperrectangle is less than sigmaper.

logfilename : string, optional (default=’DIRresults.txt’)

Name of logfile.

user_data : object, optional (default=None)

Arbitrary python object used for passing data to the objective function.

Returns :

x : array, shape = [n]

Final point obtained in the optimization.

fmin : float

The value of the function at x.

ierror : string

Status message.

Previous topic

Tutorial

This Page