GEATbx: | Main page Tutorial Algorithms M-functions Parameter/Options Example functions www.geatbx.com |
Aside from the standard initialization (uniform at random) the user may initialize a number of individuals and provide the resulting population matrix as fourth input parameter to geamain2. An application-specific initialization gives the chance of incorporating application-specific knowledge. The number of individuals in the initial population can be anything from 1 to Inf, only the number of variables must be correct (the same as defined in System.ObjFunVarBounds). All adjustments are done in initpop automatically using the following options.
The preinitialized population is send to initpop. The following options control:
The function initpop contains some examples (help initpop). The format of the variables (real, integer, binary, permutation variables - VariableFormat) is always considered.
This option controls how many preinitialized individuals (percentage of population size) should be kept unchanged in the population. If less preinitialized individuals are provided, all these individuals are kept unchanged in initial population. If more individuals are provided, only the defined percentage is kept in the initial population (individuals are selected uniform at random).
GeaOpt = geaoptset(GeaOpt, 'Special.InitPresetKeep', 0.8);
This option controls how many individuals are created uniform at random (standard initialization, uniform at random in the domain of the variables - System.ObjFunVarBounds). The proportion of uniform individuals has an lower priority than the proportion of unchanged individuals (Special.InitPresetKeep). If the number of missing individuals is smaller than defined in Special.InitUniformCreate, only the remaining proportion is created uniform at random.
GeaOpt = geaoptset(GeaOpt, 'Special.InitUniformCreate', 0.4);
This option controls how much preinitialized individuals are normally randomized. The number of normally randomized individuals is the remainder after keeping individuals unchanged (Special.InitPresetKeep) and creating individuals uniform at random (Special.InitUniformCreate).
The normally randomized individuals are randomized around preinitialized individuals. This method is called innoculation. The level of randomization is such, that 1.0 corresponds to the domain of the search space. Nevertheless, the variables of the randomized individuals may be outside the defined boundaries. Currently, the variables are not reset to the boundaries (this is a feature).
GeaOpt = geaoptset(GeaOpt, 'Special.InitPresetRand', 0.5);
The following two options (Special.InitDo and Special.InitFunction) are obsolete. You may initialize a number of individuals and provide the resulting population matrix as fourth input parameter to geamain2. This new way (version 3.x) is much more flexible. Nevertheless, for a limited time the use of an application-specific initialization function inside geamain2 is supported.
This option switches initialization with an application-specific initialization function on or off.
GeaOpt = geaoptset(GeaOpt, 'Special.InitDo', 1);
PopInit = [ 1 2 3 4 5; 10 9 8 7 6]; % Defines two initial individuals GeaOpt = geaoptset(GeaOpt, 'Special.InitDo', 11, ... 'Special.InitFunction', ''); [x, GeaOptOut] = geamain2('objfun8', GeaOpt, VLUB, PopInit);
This option contains the function name of the application specific initialization function.
GeaOpt = geaoptset(GeaOpt, 'Special.InitFunction', 'initdopi');
This option controls if any and how much good/best individuals are collected during an optimization (see colbestind). This collection is separate from the saving of text results (Output.SaveBinDataInterval) or binary data (Output.SaveBinDataInterval). The collected individuals are compared for being not identical according to the criteria in Special.CollectBest.Compare. When an individual is selected, the objective value(s) and the variables of this individual are written into an internal matrix. The collected individuals can also be written into a text file (see Special.CollectBest.WriteFile and Special.CollectBest.FileName).
A value of 0 switches the collection of individuals off. A value of 1 collects individuals every generation. Higher values collect individuals only every defined generation.
GeaOpt = geaoptset(GeaOpt, 'Special.CollectBest.Interval', 3);
This option defines the fraction of the whole population or the number of individuals to be collected as best individuals during a collection. Values smaller than 1 define a fraction of the population size. Values of 1 and larger define directly the number of individuals.
GeaOpt = geaoptset(GeaOpt, 'Special.CollectBest.Interval', 2 'Special.CollectBest.Rate', 0.15);
GeaOpt = geaoptset(GeaOpt, 'Special.CollectBest.Interval', 1 'Special.CollectBest.Rate', 4);
This option defines the comparison method for the good individuals. This ensures only distinctive individuals are collected. The individuals of the current generation are compared to each other and to the individuals already collected in previous generations. Two individuals can be compared for identity according to their variables values and/or their objective values (even multiple objective values). If the comparison yields the individuals are identical in all values, then this individual is not added to the collection.
GeaOpt = geaoptset(GeaOpt, 'Special.CollectBest.Compare', 1);
GeaOpt = geaoptset(GeaOpt, 'Special.CollectBest.Compare', 0);
GeaOpt = geaoptset(GeaOpt, 'Special.CollectBest.Compare', 2);
This option switches writing the collected individuals to a text file on. The name of the file is defined in Special.CollectBest.FileName.
GeaOpt = geaoptset(GeaOpt, 'Special.CollectBest.WriteFile', 1);
This option contains the file name to save the collected best individuals. An optional relative or absolute path may be added (employing Matlab conventions). If no path is defined, the current working directory is used.
GeaOpt = geaoptset(GeaOpt, 'Special.CollectBest.FileName', straddtime('ColInd.txt')); % filename: ColInd_2000_Aug_27_14-32.txt
1. objv 1. var 2. var 3. var 4. var 5. Var 65438 -189.83 97.117 -62.709 -90.832 -88.249 68964 -127.04 -92.959 -135.3 122.15 -104.67 81624 -7.2665 -37.553 80.748 253.08 -97.927 1.0767e+005 124.55 63.665 154.57 6.5249 253.32 21843 -122.04 69.944 -7.5338 -43.448 10.678 43095 -162.7 86.244 -40.631 -71.871 -48.664 54318 -154.47 73.266 -48.199 -106.82 -106.56 73896 -127.64 224.38 -77.343 19.578 -29.873 36771 -145.71 105.68 26.7 59.601 -10.325 50791 -148.92 104.4 -54.164 -80.84 -90.809 52756 -175.42 91.341 -50.982 -80.761 -67.224 60138 -184.06 94.804 -58.013 -86.799 -79.829
GEATbx: | Main page Tutorial Algorithms M-functions Parameter/Options Example functions www.geatbx.com |