Documentation of demofun1cmp
Global Index (all files) (short | long)
| Local contents
| Local Index (files in subdir) (short | long)
Help text
DEMO for optimizing 'De Jong's function 1 with competing strategies
This script provides an optimization example using the GEATbx.
De Jongs Function 1 is optimized using an real valued
representation.
In contrast to demofun1 different stratgies for the subpopulations
are configured. These Mutation.Range and Mutation.Precision are
defined in such a way that the change between the strategies during
an optimization can be clearly seen (by observing the lower right
graphic in the visulization window).
Syntax: demofun1cmp
Input parameter:
no input parameter
Output parameter:
no output parameter
See also: demofun1, tbx3real, tbx3comp, geamain2
Cross-Reference Information
Listing of script demofun1cmp
% Author: Hartmut Pohlheim
% History: 22.10.2000 file created
% 06.11.2005 comments updated
% Get default parameters for real variables
GeaOpt = tbx3real;
% Define special parameters
GeaOpt = geaoptset( GeaOpt ...
, 'NumberSubpopulation', 5 ... % Number of subpopulation
, 'NumberIndividuals', [15] ... % 50, 30, 20, 20, 10] ... % Number of individuals per subpopulation
, 'Output.TextInterval', 10 ... % Text output every 5 generations
...
, 'Output.GrafikInterval', 50 ... % Grafic results every 50 generations
, 'Output.GrafikMethod', 111111 ... % Grafic method to use
, 'Output.GrafikStyle', 614141 ... % Grafic styles for specified methods
...
, 'Mutation.Range', [1e-2, 1e-4, 1e-6, 1e-8, 1e-1] ... % Predefine some mutation ranges if using multiple subpopulation
, 'Mutation.Precision', [ 4 4 4 4 24] ... % Use this precision for the subpopulations
...
, 'Termination.Method', [1 ] ... % Termination method(s) to use
, 'Termination.MaxGen', 800 ... % Terminate after xx generations
, 'Termination.MaxTime', 1 ... % Terminate after xx minutes
...
, 'Competition.DivisionPressure', 1.5 ...
, 'Competition.Rate', .4 ...
);
% Define special parameters for saving results
FileNameBase = straddtime('f1_cmp_23_');
GeaOpt = geaoptset( GeaOpt ...
, 'Output.SaveTextInterval', 0 ... % Text to File every xx generations
, 'Output.SaveTextFilename', [FileNameBase '.txt'] ... % Filename of result file, absolut or relative path may be included
, 'Output.SaveBinDataInterval', 0 ... % Binary Data to File every xx generations
, 'Output.SaveBinDataFilename', [FileNameBase '.mat'] ... % Filename of binary file, absolut or relative path may be included
);
% Add parameters for competition between subpopulations
GeaOpt = geaoptset( GeaOpt , tbx3comp);
% Define objective function to use
GeaOpt = geaoptset( GeaOpt , 'System.ObjFunFilename', 'objfun1');
objfun = []; % 'objfun1';
% Get variable boundaries from objective function
VLUB = geaobjpara(GeaOpt.System.ObjFunFilename, [1 10]);
GeaOpt = geaoptset( GeaOpt , 'System.ObjFunVarBounds', VLUB);
VLUB = [];
% Do a mesh plot of objective function
% plotmesh(objfun, [-100,-100;100,100]);
% Start optimization
[xnew, GeaOpt] = geamain2(objfun, GeaOpt, VLUB, []);
% End of script
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).