GEATbx: Options 11 Objective function options





11 Objective function options
All options in this subsection are used to define/store properties of the objective function to solve: function name of the objective function, an optional description, the boundaries of the variables, additional parameters etc. The objective function name and the boundaries of the variables can also be defined by including the appropriate parameters when calling geamain2. Then these options are set inside geamain2.
System.ObjFunFilename
This option defines the name of the objective function. The name is exactly the name of the m-file (without the extension .m).
- Default value: 'objfun1'
- Type: string
- The objective function name can also be defined by setting the first input parameter when calling geamain2 to the name of the objective function (standard calling syntax of geamain2). Then this option is set inside geamain2. The value inside the first input parameter of geamain2 has a higher priority than the value in System.ObjFunFilename.
- Example - define the name of the objective function to use:
GeaOpt = geaoptset(GeaOpt, 'System.ObjFunFilename', 'objfun6');
- Option number in previous versions: not available as option (2.x and 1.x)
System.ObjFunVarBounds
This option defines the boundaries of the variables. The definition of these values is important for a useful optimization. The defined values span the search space of the optimization. These boundaries are hard constraints (exceptions can be defined with System.ObjFunVarBoundOut). By defining the boundaries the number of variables is given as well. This option is often referred to as VLUB (Vector of Lower and Upper Bounds).
- Default value: [ ]
- Type: 2-row matrix of scalars in (-Inf, Inf)
- The boundary matrix has two rows. The first row contains the lower variable boundaries, the second row the upper boundaries. The first column defines the boundaries for the first variable, the second for the second and so on.
- The boundaries of the variables can also be defined by setting the third input parameter when calling geamain2 to the matrix of the boundaries (standard calling syntax of geamain2). Then this option is set inside geamain2. The value inside the third input parameter of geamain2 has a higher priority than the value in System.ObjFunVarBounds. When the boundaries are defined inside System.ObjFunVarBounds, just set the third input parameter of geamain2 to [] or call geamain2 with 2 input parameters only.
- Example - define the variable boundaries of 5 variables in System.ObjFunVarBounds:
GeaOpt = geaoptset(GeaOpt, 'System.ObjFunVarBounds', ...
[-1, 0, 1, 5.48, -2.1; ...
1, 1, 20, 5.82, -1.1]);
[x, GeaOptOut] = geamain2('objfun8', GeaOpt, []);
- Example - define a variable with the variable boundaries, use them as third input to geamain2:
VLUB = [-1, 0, 1, 5.48, -2.1;
1, 1, 20, 5.82, -1.1]);
[x, GeaOptOut] = geamain2('objfun8', GeaOpt, VLUB);
- This option must be set for every system. The GEATbx contains a mechanism to encapsulate these values inside the objective function. Please look at the description of geaobjpara or any of the provided examples (obj*.m). All provided example objective functions contain this mechanism, which is automatically used.
- Please take your time to define appropriate values for the boundaries of the variables. If you are looking for good values in the range [0.1 0.2], a definition of boundaries in the range [0, 1000] would produce a much more difficult optimization problem. An appropriate definition of the variable boundaries is one of the most important prerequisites for the successful solution of an optimization problem.
- Option number in previous versions: not available as option (2.x and 1.x)
System.ObjFunAddPara
This option contains the additional parameters of the objective function (inside an cell array). The number of additional parameters is not limited.
- Default value: {}
- Type: cell array with elements of any type
- The additional parameters of the objective function can also be defined by providing them as additional input parameter when calling geamain2 (standard calling syntax of geamain2). Then this option is set inside geamain2. The value inside System.ObjFunAddPara has a lower priority than the values in the 5+ input parameters of geamain2.
- Example - define two additional parameters, first parameter is row vector with 3 numbers, second parameter is a string containing the word 'one'. Both parameters are contained in one cell array:
GeaOpt = geaoptset(GeaOpt, 'System.ObjFunAddPara', {[1 2 3], 'one'});
[x, GeaOptOut] = geamain2('objfun8', GeaOpt);
- Example - provide the above two additional parameters directly when calling geamain2:
[x, GeaOptOut] = geamain2('objfun8', GeaOpt, VLUB,[],[1 2 3],'one');
- Option number in previous versions: not available as option (2.x and 1.x)
System.ObjFunVarBoundOut
Using this option, the defined variable boundaries may be changed from hard boundaries to soft boundaries. A value of 0 defines a hard bound, a value of 1 a soft bound. This option is used inside chkbound to reset (or not) variables outside the defined boundaries. The initialization of variables is always done inside the defined boundaries (irrespective of the settings in System.ObjFunVarBoundOut).
- Default value: []
- Type: 2-row matrix with integers in {0, 1}, same size as System.ObjFunVarBounds
- Example - define soft boundaries for the lower bound of the second variable and the upper bound of the fourth variable. All other bounds are hard bounds:
GeaOpt = geaoptset(GeaOpt, 'System.ObjFunVarBoundOut',
[ 0, 1, 0, 0, 0;
0, 0, 0, 1, 0]);
- Option number in previous versions: not available (2.x and 1.x)
System.ObjFunGoals
This option defines the goals of multiple objective values and is used in multi-objective optimization.
- Default value: []
- Type: vector of scalars in [-Inf, Inf]
- Example - set the goals for an objective function with 4 objective values:
GeaOpt = geaoptset(GeaOpt, 'System.ObjFunGoals', [-1.3, 4, 2, 0]);
- Multi-objective optimization is a large topic on its own. Some work is still to be done, including the description of the internal working of multi-objective optimization. Examples are provided in demomop, plotmop and mobjfonseca1.
- This option corresponds with Selection.RankingMultiobj.
- Option number in previous versions: not available (2.x and 1.x)
System.ObjFunMinimum
This option defines the/one known minimum of the objective function (best objective value). This option is used for termination (when a given objective value is reached).
- Default value: -Inf
- Type: scalar in [-Inf, Inf]
- Example - define the minimal objective value of the objective function to 0:
GeaOpt = geaoptset(GeaOpt, 'System.ObjFunMinimum', 0);
- Option number in previous versions: not available as option (2.x and 1.x), internal in objective function
System.ObjFunDescription
This option defines a textual description of the objective function. Currently, this option is not directly used inside the GEATbx.
- Default value: 'Objfun descr.'
- Type: string
- Example - include a description of the objective function (here for objfun6):
GeaOpt = geaoptset(GeaOpt, 'System.ObjFunDescription',
'RASTRIGINs Function 6');
- Option number in previous versions: not available as option (2.x and 1.x), internal in objective function






This document is part of
version 3.8 of the
GEATbx: Genetic and Evolutionary Algorithm Toolbox for use with Matlab -
www.geatbx.com.
The Genetic and Evolutionary Algorithm Toolbox is
not public domain.
© 1994-2006 Hartmut Pohlheim, All Rights Reserved,
(support@geatbx.com).