Documentation of geaoptset

Global Index (all files) (short | long) | Local contents | Local Index (files in subdir) (short | long)

Function Synopsis

geaopt = geaoptset(varargin)

Help text

 Create/alters GEAOPTions structure for parameter SETtings of GEA Toolbox

 This function creates or alters geaoptions structures, which include the 
 options of the GEA Toolbox.
 This function can be used for:
  - creating a new complete geaoptions structure, all values set to defaults
  - create a new partial geaoptions structure with given properties
  - combine two or more predefined geaoptions structures into one
  - change given properties of a geaoptions structure 
 The Example section below provides examples for all these possibilities.

 Syntax:  geaopt = geaoptset(P1, P2, P3, P4, ...)

 Input parameter:
    See Examples below for description of possible inputs types and their 
    corresponding functionality.

 Output parameter:
    GEAOPT    - Structure with newly defined options

 Examples:
 
  geaoptset 
     Called with no input and output arguments displays all property names and
     their possible values, including the default value. geaoptset property
     defaults for any unspecified property are taken from the values specified
     inside this function.

  geaopt_full = geaoptset 
     Called with no input arguments returns a geaoptions structure with all 
     possible property names and set to their default value.

  geaopt_part = geaoptset('name', value1, 'name2', value2, ...) 
     Creates a partial geaoptions structure in which the given 
     properties have the specified values.  It is sufficient to 
     type only the leading characters that uniquely identify the property.
     Case is ignored for the property names.
     geaopt_part = geaoptset('Mutation.Name', 'mutint', 'Mutation.Range', 0.1)
        The structure geaopt_part contains just the fields 'Mutation.Name'
        and 'Mutation.Range' set to the specified values.

  geaopt = geaoptset(geaoptold, 'name1', value1, ...) 
     Alters an existing geaoptions structure geaoptold using the given
     properties.
     geaopt_new = geaoptset(geaopt_part, 'Recombination.Name', 'recdis', Mutation.Name', 'mutreal')
        The structure geaopt_part defined in the previous example is extended 
        with the property 'Recombination.Name'. The property 'Mutation.Name' 
        is set to a new value.

  geaopt = geaoptset(geaoptold, geaoptnew) 
     Combines an existing geaoptions structure geaoptold with a new 
     geaoptions structure geaoptnew. Any new properties overwrite 
     corresponding old properties.
     geaopt_all = geaoptset(geaoptset, geaopt_new)
        The full and default structure returned by geaoptset (see second 
        example above) is redefined with the properties from geaopt_new, 
        which was preset in the examples above.

  geaopt = geaoptset(geaoptcheck)
     When called with just one geaoptions structure as input parameter, the values 
     of these properties are checked (violation of boundaries, when multi strategy - then
     the number of values is set to the number of subpopulations and so on).

 See also: paraoptset for a full description, geamain2, compdiv, geaoptprint

Cross-Reference Information

This function calls This function is called by

Listing of function geaoptset



% Author:   Hartmut Pohlheim
% History:  20.10.1998  file created
%           21.10.1998  interface defined
%                       property names of structure defined
%           28.10.1998  finished definition, setting and combination of 
%                          geaoptions structure
%           29.10.1998  replaced fprintf by sprintf and disp in output of 
%                          default values, much quicker now
%           xx.11.1998  added more properties as needed
%           05.11.1998  number of parameters for every property is checked 
%                          against defined possibilities in PropMulti
%           25.05.1999  check of parameter boundaries added, values are reset 
%                          to boundaries, when outside
%                       when parameter integer, then round of parameter
%           02.06.1999  reworked all getfield/setfield to muli sub index working
%           06.12.1999  new parameters for Gui handling (Name, FigureTag)
%           14.12.1999  added TextExclude parameters
%           14.03.2000  moved large data property cell array in private 
%                          subfunction (needed for C++-compilation)
%           14.09.2000  moved printing of default cell array to subfunction
%           15.05.2001  added parameter Competition.DivisionPressure
%           04.10.2002  call into extra function paraoptset for main functionality


function geaopt = geaoptset(varargin)


% Define possible properties, their default types, values and the ranges or possible values
   % Get cell array with properties (name, type range, default value) from private function
   [PARAProp, PropAssign] = geaoptpropdef;

% Call the utility function for all the data handling
   if all([nargout == 0, nargin == 0]), paraoptset({PARAProp, PropAssign});
   else geaopt = paraoptset({PARAProp, PropAssign}, varargin{:}); end
   

% End of function




% Private function
%
% This private function creates and returnes a default GEAOPTions cell array.
%
% Syntax:  [GEAProp, PropAsign] = geaoptpropdef
%
% See also: geaoptset, paraoptset

% Author:   Hartmut Pohlheim
% History:  14.03.2000  file created
%           06.04.2000  options for collecting good individuals added


function [GEAProp, PropAssign] = geaoptpropdef,


     
   % Define assignment of row to value in property cell array
   PropName = 1; PropType = 2; PropDefval = 3; PropRange = 4; PropMulti = 5;
   PropAssign = [PropName, PropType, PropDefval, PropRange, PropMulti];
   
   % See paraoptset for a full description
   % AbrGEAPropType = strvcat('integer', 'scalar', 'string', 'scalar', 'all');
   % AbrGEAPropMulti = strvcat('just one', 'num. subpop', 'multi');
   % GEAPropHeading = ['   Property Name        Type       Default value   min.  Range   max.    Number of para.   '];

   GEAProp = [ ...
       {'NumberMulti'},                  {3},{'NumberSubpopulation'},{[NaN NaN]},  {0}; ...
       {'NumberSubpopulation'},          {1},     {4},               {[1 Inf]},    {0}; ...
       {'NumberIndividuals'},            {1},     {[25,20,15,30]},   {[1 Inf]},    {1}; ...
       {'VariableFormat'},               {1},     {0},               {[0  5]},     {0}; ...
       {'NumberObjectives'},             {1},     {1},               {[1 Inf]},    {0}; ...
       {'Selection.Name'},               {3},     {{'selsus'}},      {[NaN NaN]},  {1}; ...
       {'Selection.Pressure'},           {2},     {[1.7]},           {[0 Inf]},    {1}; ...
       {'Selection.RankingMethod'},      {2},     {[0]},             {[0  1]},     {1}; ...
       {'Selection.RankingMultiobj'},    {1},     {[0]},             {[0 Inf]},    {1}; ...
       {'Selection.GenerationGap'},      {2},     {[0.9]},           {[0 Inf]},    {1}; ...
       {'Selection.ReinsertionRate'},    {2},     {[1]},             {[0  1]},     {1}; ...
       {'Selection.ReinsertionMethod'},  {1},     {[2]},             {[0  6]},     {1}; ...
       {'Selection.LocalDimension'},     {1},     {[0]},             {[0  Inf]},   {1}; ...
       {'Selection.LocalTopology'},      {1},     {[0]},             {[0  19]},    {1}; ...
       {'Selection.LocalDistance'},      {1},     {[1]},             {[1  Inf]},   {1}; ...
       {'Recombination.Name'},           {3},     {{'recdis'}},      {[NaN NaN]},  {1}; ...
       {'Recombination.Rate'},           {2},     {[1]},             {[0  1]},     {1}; ...
       {'Mutation.Name'},                {3},     {{'mutreal'}},     {[NaN NaN]},  {1}; ...
       {'Mutation.Rate'},                {2},     {[1]},             {[0 Inf]},    {1}; ...
       {'Mutation.Range'},               {2},     {[0.1]},           {[0  1]},     {1}; ...
       {'Mutation.Precision'},           {2},     {[12]},            {[1 Inf]},    {1}; ...
       {'Migration.Do'},                 {1},     {1},               {[0  1]},     {0}; ...
       {'Migration.Interval'},           {1},     {20},              {[1 Inf]},    {0}; ...
       {'Migration.Rate'},               {2},     {0.1},             {[0  1]},     {0}; ...
       {'Migration.Topology'},           {1},     {0},               {[0  2]},     {0}; ...
       {'Migration.Selection'},          {1},     {1},               {[0  1]},     {0}; ...
       {'Competition.Do'},               {1},     {0},               {[0  1]},     {0}; ...
       {'Competition.Interval'},         {1},     {4},               {[1 Inf]},    {0}; ...
       {'Competition.Rate'},             {2},     {0.1},             {[0  1]},     {0}; ...
       {'Competition.SubpopMinimum'},    {1},     {[5]},             {[1 Inf]},    {1}; ...
       {'Competition.DivisionPressure'}, {1},     {2},               {[1 Inf]},    {0}; ...
       {'Termination.Method'},           {1},     {[1]},             {[1 Inf]},    {2}; ...
       {'Termination.MaxGenerations'},   {1},     {100},             {[1 Inf]},    {0}; ...
       {'Termination.MaxTime'},          {2},     {10},              {[0 Inf]},    {0}; ...
       {'Termination.Diff2Optimum'},     {2},     {1e-4},            {[0 Inf]},    {0}; ...
       {'Termination.RunningMean'},      {2},     {0},               {[0 Inf]},    {0}; ...
       {'Termination.StdObjV'},          {2},     {1e-3},            {[0 Inf]},    {0}; ...
       {'Termination.GoodWorstObjV'},    {2},     {1e-1},            {[0 Inf]},    {0}; ...
       {'Termination.Phi'},              {2},     {1e-6},            {[0 Inf]},    {0}; ...
       {'Termination.Kappa'},            {2},     {1e-6},            {[0 Inf]},    {0}; ...
       {'Termination.Cluster'},          {2},     {0},               {[0 Inf]},    {0}; ...
       {'Output.TextInterval'},          {1},     {1},               {[0 Inf]},    {0}; ...
       {'Output.TextExcludeHead'},       {1},     {0},               {[0 1]},      {0}; ...
       {'Output.TextExcludePara'},       {1},     {0},               {[0 1]},      {0}; ...
       {'Output.TextExcludeInd'},        {1},     {1},               {[0 1]},      {0}; ...
       {'Output.TextExcludeSub'},        {1},     {0},               {[0 1]},      {0}; ...
       {'Output.TextExcludeTerm'},       {1},     {0},               {[0 1]},      {0}; ...
       {'Output.TextExcludeTime'},       {1},     {0},               {[0 1]},      {0}; ...
       {'Output.GrafikInterval'},        {1},     {0},               {[0 Inf]},    {0}; ...
       {'Output.GrafikMethod'},          {1},     {[111111]},        {[0 1e10]},   {0}; ...
       {'Output.GrafikStyle'},           {1},     {[0]},             {[0 1e10]},   {0}; ...
       {'Output.GrafikStartGen'},        {1},     {[1]},             {[1  Inf]},   {0}; ...
       {'Output.GrafikEndGen'},          {1},     {[Inf]},           {[1  Inf]},   {0}; ...
       {'Output.StatePlotInterval'},     {1},     {0},               {[0 Inf]},    {0}; ...
       {'Output.StatePlotFunction'},     {3},     {' '},             {[NaN NaN]},  {0}; ...
       {'Output.SaveTextInterval'},      {1},     {0},               {[0 Inf]},    {0}; ...
       {'Output.SaveTextFilename'},      {3},     {'res_gea.txt'},   {[NaN NaN]},  {0}; ...
       {'Output.SaveTextExcludeHead'},   {1},     {0},               {[0 1]},      {0}; ...
       {'Output.SaveTextExcludePara'},   {1},     {0},               {[0 1]},      {0}; ...
       {'Output.SaveTextExcludeInd'},    {1},     {0},               {[0 1]},      {0}; ...
       {'Output.SaveTextExcludeSub'},    {1},     {0},               {[0 1]},      {0}; ...
       {'Output.SaveTextExcludeTerm'},   {1},     {0},               {[0 1]},      {0}; ...
       {'Output.SaveTextExcludeTime'},   {1},     {0},               {[0 1]},      {0}; ...
       {'Output.SaveBinDataInterval'},   {1},     {0},               {[0 Inf]},    {0}; ...
       {'Output.SaveBinDataFilename'},   {3},     {'res_gea.mat'},   {[NaN NaN]},  {0}; ...
       {'System.ObjFunFilename'},        {3},     {'objfun1'},       {[NaN NaN]},  {0}; ...
       {'System.ObjFunDescription'},     {3},     {'Objfun descr.'}, {[NaN NaN]},  {0}; ...
       {'System.ObjFunVarBounds'},       {4},     {[]},              {[NaN NaN]},  {2}; ...
       {'System.ObjFunVarBoundOut'},     {1},     {[]},              {[NaN NaN]},  {2}; ...
       {'System.ObjFunVar2ObjV'},        {1},     {[]},              {[NaN NaN]},  {2}; ...
       {'System.ObjFunAddPara'},         {5},     {{}},              {[NaN NaN]},  {2}; ...
       {'System.ObjFunMinimum'},         {4},     {-Inf},            {[NaN NaN]},  {0}; ...
       {'System.ObjFunGoals'},           {4},     {[]},              {[NaN NaN; 1 1]},  {2}; ...
       {'Run.Generation'},               {1},     {1},               {[NaN NaN]},  {0}; ...
       {'Run.CountObjFun'},              {1},     {0},               {[NaN NaN]},  {0}; ...
       {'Run.DoTerminate'},              {1},     {0},               {[NaN NaN]},  {0}; ...
       {'Run.BestObjectiveValue'},       {4},     {Inf},             {[NaN NaN]},  {0}; ...
       {'Special.InitPresetKeep'},       {2},     {0.5},             {[0  1]},     {0}; ...
       {'Special.InitPresetRand'},       {2},     {0.25},            {[0  1]},     {0}; ...
       {'Special.InitUniformCreate'},    {2},     {0.5},             {[0  1]},     {0}; ...
       {'Special.InitDo'},               {1},     {0},               {[0 21]},     {0}; ...
       {'Special.InitFunction'},         {3},     {' '},             {[NaN NaN]},  {0}; ...
       {'Special.InitIndividuals'},      {4},     {[]},              {[NaN NaN]},  {2}; ...
       {'Special.CollectBest.Interval'}, {1},     {0},               {[0  Inf]},   {0}; ...
       {'Special.CollectBest.Rate'},     {2},     {0.1},             {[0  Inf]},   {0}; ...
       {'Special.CollectBest.Compare'},  {1},     {0},               {[-1  2]},     {0}; ...
       {'Special.CollectBest.CacheSize'},{2},     {1000},            {[0  Inf]},   {0}; ...
       {'Special.CollectBest.WriteFile'},{1},     {0},               {[0  1]},     {0}; ...
       {'Special.CollectBest.FileName'}, {3},     {'CollectBestInd'},{[NaN NaN]},  {0}; ...
       {'Special.Elitest.Rate'},         {2},     {0.1},             {[0  1]},     {0}; ...
       {'Special.DPGEA'},                {1},     {0},               {[0  1]},     {0}; ...
       {'Gui.Use'},                      {1},     {0},               {[NaN NaN]},  {0}; ...
       {'Gui.Name'},                     {3},     {'geagui'},        {[NaN NaN]},  {0}; ...
       {'Gui.FigureTag'},                {3},     {'geatbxfiggui1'}, {[NaN NaN]},  {0}; ...
       {'Gui.ChangedPara'},              {1},     {0},               {[NaN NaN]},  {0}; ...
       {'Gui.RunStopPause'},             {1},     {0},               {[NaN NaN]},  {0}; ...
      ];             

   % Gui.RunStopPause
   % 0: don't know
   % 1: Run (is running), Start (start opt)
   % 2: Pause (pause opt)
   % 3: Stop (stop opt)
   % 4: Step (just 1 gen more)


% End of private function
GEATbx: Main page  Tutorial  Algorithms  M-functions  Parameter/Options  Example functions  www.geatbx.com 

This document is part of version 3.7 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-2005 Hartmut Pohlheim, All Rights Reserved, (support@geatbx.com).