Documentation of recint

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

Function Synopsis

NewChrom = recint(OldChrom, RecRate);

Help text

 RECombination extended INTermediate

 This function performs extended intermediate recombination between
 pairs of individuals and returns the new individuals after mating.

 Syntax:  NewChrom = recint(OldChrom, RecRate)

 Input parameters:
    OldChrom  - Matrix containing the chromosomes of the old
                population. Each row corresponds to one
                individual
    RecRate   - Probability of recombination ocurring between pairs
                of individuals. (not used, only for compatibility)

 Output parameter:
    NewChrom - Matrix containing the chromosomes of the population
               after mating, ready to be mutated and/or evaluated,
               in the same format as OldChrom.

 See also: recombine, recdis, reclin, recmut, recsp, recdp, recsh

Cross-Reference Information

This function is called by

Listing of function recint



%  Author:    Hartmut Pohlheim
%  History:   25.11.94     file created
%             06.12.94     change of name of function
%             25.02.95     clean up
%             19.03.95     multipopulation support removed


function NewChrom = recint(OldChrom, RecRate);

% Identify the population size (Nind) and the number of variables (Nvar)
   [Nind,Nvar] = size(OldChrom);

% Identify the number of matings
   Xops = floor(Nind/2);

% Performs recombination
   odd = 1:2:Nind-1;
   even= 2:2:Nind;

   % position of value of offspring compared to parents
   Alpha = -0.25 + 1.5 * rand(Xops,Nvar);

   % recombination
   NewChrom(odd,:)  = OldChrom(odd,:) + Alpha .* (OldChrom(even,:) - OldChrom(odd,:));

   % the same ones more for second half of offspring
   Alpha = -0.25 + 1.5 * rand(Xops,Nvar);
   NewChrom(even,:) = OldChrom(odd,:) + Alpha .* (OldChrom(even,:) - OldChrom(odd,:));

% If the number of individuals is odd, the last individual cannot be mated
% but must be included in the new population
   if rem(Nind,2),  NewChrom(Nind,:)=OldChrom(Nind,:); end


% End of 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).