Home > Mateda2.0 > replacement > best_elitism.m

# best_elitism

## PURPOSE

[NewPop,NewFunVal] = best_elistism(Pop,SelPop,SampledPop,FunVal,SelFunVal,SampledFunVal,replacement_params)

## SYNOPSIS

function [NewPop,NewFunVal] = best_elistism(Pop,SelPop,SampledPop,FunVal,SelFunVal,SampledFunVal,replacement_params)

## DESCRIPTION

     [NewPop,NewFunVal] = best_elistism(Pop,SelPop,SampledPop,FunVal,SelFunVal,SampledFunVal,replacement_params)
     best_elitism:              Creates a new population (NewPop) joining (all) the best individuals
                               individuals in SelPop with the SamplePopSize best individuals from SampledPop
                               This method is appropriate for truncation selection and it should be  enforced that
                               SamplePopSize = PopSize - SelPopSize.
     INPUTS
     Pop:                                 Current population
     SelPop:                              Current selected population
     SampledPop:                          Population sampled from the probabilistic model
     CurrentFunVal:                       A matrix of function evaluations, one vector of m objectives for each individual
     OUTPUTS
     NewPop                        : New Population
     NewFunVal                     : Evaluations of the new population

     Last version 8/26/2008. Roberto Santana (roberto.santana@ehu.es)

## CROSS-REFERENCE INFORMATION

This function calls:

This function is called by:

## SOURCE CODE

    0001 function [NewPop,NewFunVal] = best_elistism(Pop,SelPop,SampledPop,FunVal,SelFunVal,SampledFunVal,replacement_params)
    0002 % [NewPop,NewFunVal] = best_elistism(Pop,SelPop,SampledPop,FunVal,SelFunVal,SampledFunVal,replacement_params)
    0003 % best_elitism:              Creates a new population (NewPop) joining (all) the best individuals
    0004 %                           individuals in SelPop with the SamplePopSize best individuals from SampledPop
    0005 %                           This method is appropriate for truncation selection and it should be  enforced that
    0006 %                           SamplePopSize = PopSize - SelPopSize.
    0007 % INPUTS
    0008 % Pop:                                 Current population
    0009 % SelPop:                              Current selected population
    0010 % SampledPop:                          Population sampled from the probabilistic model
    0011 % CurrentFunVal:                       A matrix of function evaluations, one vector of m objectives for each individual
    0012 % OUTPUTS
    0013 % NewPop                        : New Population
    0014 % NewFunVal                     : Evaluations of the new population
    0015 %
    0016 % Last version 8/26/2008. Roberto Santana (roberto.santana@ehu.es)
    0017
    0018
    0019 find_bestinds_method = char(cellstr(replacement_params{1,1}));
    0020 PopSize = size(Pop,1);
    0021 SelPopSize = size(SelPop,1);
    0022 SampledPopSize = size(SampledPop,1);
    0023
    0024 AuxPopSize = PopSize - SelPopSize;
    0025
    0026 [Ind]  = eval([find_bestinds_method,'(SampledPop,SampledFunVal)']);  % The  best AuxPopSize individuals are found
    0027 Ind = Ind(1:AuxPopSize);
    0028
    0029 NewPop(1:AuxPopSize,:) = SampledPop(Ind,:);
    0030 NewFunVal(1:AuxPopSize,:) = SampledFunVal(Ind,:);
    0031
    0032 NewPop(AuxPopSize+1:PopSize,:) = SelPop;
    0033 NewFunVal(AuxPopSize+1:PopSize,:) = SelFunVal;
    0034
    0035
    0036 return
    0037
    0038
    0039