Global Index (all files) (short | long) | Local contents | Local Index (files in subdir) (short | long)
[Chrom, VLUB] = initpop(PopInit, Nind, VLUB, InitOpt);
INITialization of POPulation (including innoculation) This function initializes the population with individuals taken from the provided input matrix PopInit. This initialization function checks, if the number of varibales of the individuals from PopInit is identical to the number of variables defined in the boundaries array VLUB. Additionally, based on the provided individuals similar individuals are produced and included into the population Chrom. The level of randomization and the number of unchanged individuals in the population Chrom can be controlled by the options in InitOpt. When PopInit is empty, standard random initialization of the individuals is done (depending on VariableFormat). Syntax: [Chrom, VLUB] = initpop(PopInit, Nind, VLUB, InitOpt) Input parameters: PopInit - Vector or matrix containing the initial individuals may be any number of individuals if PopInit is empty, a uniform at random initialization of individuals takes place Nind - Number of individuals to create at all VLUB - Matrix containing the boundaries of the variables InitOpt - parameter for initialization InitOpt(1): InitVariableFormat format/representation of variables (real, integer, binary), see options of GEATbx (VariableFormat) standard: 0 (real variable representation) InitOpt(2): InitRand level of randomization of (innoculated) individuals 0: no randomization, no similar individuals are produced >0: randomize individuals using the following equation (randn/4 * InitRand * domain of variable) standard: 0.25 InitOpt(3): InitNindKeep keep preinitialized individuals in population (unchanged) 0: keep none of them > 0 (max 1): scalar (percentage of population size) how many individuals from PopInit to copy to Chrom standard: 0.2 (keep not more than 20% of individuals in final population) InitOpt(4): InitNindUniform create some individuals uniform at random in defined domain of variables (boundaries VLUB) - uses the standard init functions initrp, initip, initbp and initpp 0: create none > 0 (max 1): scalar (percentage of population size) how standard: 0 (creatze no individuals uniform at random) many individuals to create uniform at random if InitNindKeep+InitNindUniform > 1: InitNindUniform is reduced if 1-InitNindKeep+InitNindUniform > 0: this defines the percentage of individuals (InitNindRand) to create by innoculation with the provided individuals in PopInit und randomization defined by InitRand Output parameters: Chrom - Matrix containing the individuals of the current population. Each row corresponds to one individual's representation. VLUB - (optional) Matrix containing the (new) boundaries of the variables (not changed here), same as input parameter Examples: % Preparation for all examples: % create initial individuals and corresponding boundary matrix >> popinit = repmat([1;2;3;4], [1, 7]); >> vlub = repmat([0;10], [1, 7]); % Get a uniform at random initialized population with 25 real valued individuals >> newpop = initpop([], 25, vlub) % Get a uniform at random initialized population with 25 integer valued individuals >> newpop = initpop([], 25, vlub, 2) % Create a preinitialized population of 40 individuals with standard options >> newpop = initpop(popinit, 40, vlub); % Get an impression of the distribution of the individuals >> plot(newpop'); % Create a preinitialized population of 60 real valued individuals, % keep all initial variables (InitOpt(3) == 1), create fully (uniform) random % individuals (50% of population size = 30 ind.) and create also innoculated % individuals (reminding individuals) in an area of 40% around the initial ind. >> newpop = initpop(popinit, 60, vlub, [0, 0.4, 1, 0.5]); % Create a preinitialized population of 50 real valued individuals, % keep no initial variables (InitOpt(3) == 0), create only innoculated % individuals in an area of 20% around the initial individuals >> newpop = initpop(popinit, 50, vlub, [0, 0.2, 0, 0]); See also: initrp, initip, initbp, initpp, geamain2
This function calls | This function is called by |
---|---|