Global Index (all files) (short | long) | Local contents | Local Index (files in subdir) (short | long)
NewChromIx = seltrunc(FitnV, Nsel, Dummy);
SELection by TRUNCation This function performs SELection by TRUNCation. Syntax: NewChromIx = seltrunc(FitnV, Nsel) Input parameters: FitnV - Column vector containing the fitness values of the individuals in the population. Nsel - Number of individuals to be selected Output parameters: NewChromIx- Column vector containing the indexes of the selected individuals relative to the original population, shuffeld. The new population, ready for mating, can be obtained by calculating OldChrom(NewChromIx,:). For the truncation threshold the inverse of the selection pressure is used (Trunc = 1/SP). 1/SP is computed from FitnV by mean(FitnV)/max(FitnV) See also: selection, selsus, selrws, seltour, sellocal Example: % define fitness vector FitnV = [.1; .9; 1.6; 2.0; 0.4; 1.3; 1.7; 0.7; 0.2]; % selects 6 indices from FitnV, Trunc = 0.5; NewChromIx = seltrunc(FitnV, 6); % possible result NewChromIx = [3; 4; 2; 4; 6; 7]; % Get selected individuals from population Chrom SelChrom = Chrom(NewChromIx, :)
This function calls | This function is called by |
---|---|