Abstract base class for an optimizer. More...
Public Member Functions | |
function | Optimizer (var varargin) |
Creates an Optimizer object, not to be called directly. | |
function | getBounds () |
Returns bounds for optimizers that need it. | |
function | setBounds (var LB, var UB) |
Sets bounds for optimizers that need it. | |
function | getInitialPopulation () |
Gets the starting positions for the search. | |
function | setInitialPopulation (var pop) |
Sets the starting positions for the search. | |
function | getInputDimension () |
Returns the number of input variables. | |
function | getOutputDimension () |
Returns the number of cost functions. | |
function | setDimensions (var inDim, var outDim) |
Sets the number of input and output dimensions. | |
function | setHint (var key, var value) |
Gives a hint to the optimizer. | |
function | getHint (var key) |
Gets a hint to the optimizer. | |
function | setState (var state) |
Sets some extra information. | |
function | getState () |
Gets some extra information. | |
function | getPopulationSize () |
Get the number of individuals in the population. | |
function | setInputConstraints (var con) |
Sets input constraints. | |
function | optimize (var arg) |
This function optimizes the given function handle,. | |
Abstract base class for an optimizer.
Optimization methods are to be derived from this class. It provides a logger object for the derived classes and instantiates all constraints
|
inline |
function getBounds | ( | ) |
Returns bounds for optimizers that need it.
Only needed for optimization methods that support it.
LB | lower bound |
UB | upper bound |
function getHint | ( | var | key | ) |
Gets a hint to the optimizer.
Returns a particular hint setting.
key | property name |
value | property value |
function getInitialPopulation | ( | ) |
Gets the starting positions for the search.
pop may be a matrix for population-based, multi-start, etc. methods
startx | matrix of initial values |
function getInputDimension | ( | ) |
Returns the number of input variables.
nvars | Number of input variables |
function getOutputDimension | ( | ) |
Returns the number of cost functions.
Returns the number of output variables.
nobjectives | Number of cost functions |
function getPopulationSize | ( | ) |
Get the number of individuals in the population.
The base method assumes only 1 individual.
size | Population size |
Population-based optimization methods should override this
|
inline |
Gets some extra information.
state | structure |
function optimize | ( | var | arg | ) |
This function optimizes the given function handle,.
Dummy function. Subclasses should implement this function.
subject to constraints
arg | function handle |
x | optimal input point(s) |
fval | optimal function value(s) |
function setBounds | ( | var | LB, |
var | UB | ||
) |
Sets bounds for optimizers that need it.
Only needed for optimization methods that support it.
LB | lower bound |
UB | upper bound |
function setDimensions | ( | var | inDim, |
var | outDim | ||
) |
Sets the number of input and output dimensions.
Includes some input checking to ensure that the bounds and the initial population are still correct.
inDim | Number of input variables |
outDim | Number of cost functions |
If not, these variables are reset to their default values without warning!
function setHint | ( | var | key, |
var | value | ||
) |
Gives a hint to the optimizer.
Sets a hint that may or not be honored by the optimizer (depends on the type...).
key | property name |
value | property value |
Only supports 'maxTime', time atm.
function setInitialPopulation | ( | var | pop | ) |
Sets the starting positions for the search.
Sets the initial population.
pop | matrix of initial values |
function setInputConstraints | ( | var | con | ) |
Sets input constraints.
By default the optimizer doesn't support constraints (gives error).
con | constraint objects (cell array) |
Derived classes should override this method if they do support it.
|
inline |
Sets some extra information.
state | structure |