Home > Mateda2.0 > selection > prop_selection.m

# prop_selection

## PURPOSE

[SelPop,SelFunVal]= prop_selection(Pop,FunVal,selection_params)

## SYNOPSIS

function[SelPop,SelFunVal]= prop_selection(Pop,FunVal,selection_params)

## DESCRIPTION

     [SelPop,SelFunVal]= prop_selection(Pop,FunVal,selection_params)

     prop_selection:       Proportional selection for single objective functions
     INPUTS
     Pop:                          Original population
     FunVal:                       A matrix of function evaluations, one vector of m objectives for each individual
     OUTPUTS
     SelPop: Selected population
     SelFunVal:  A vector of function evaluations for each selected individual

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

## CROSS-REFERENCE INFORMATION

This function calls:

- sus [Index]=sus(SelCant,Sumvector)

This function is called by:

## SOURCE CODE

    0001 function[SelPop,SelFunVal]= prop_selection(Pop,FunVal,selection_params)
    0002 % [SelPop,SelFunVal]= prop_selection(Pop,FunVal,selection_params)
    0003 %
    0004 % prop_selection:       Proportional selection for single objective functions
    0005 % INPUTS
    0006 % Pop:                          Original population
    0007 % FunVal:                       A matrix of function evaluations, one vector of m objectives for each individual
    0008 % OUTPUTS
    0009 % SelPop: Selected population
    0010 % SelFunVal:  A vector of function evaluations for each selected individual
    0011 %
    0012 % Last version 8/26/2008. Roberto Santana (roberto.santana@ehu.es)
    0013
    0014    PopSize = size(Pop,1);
    0015
    0016    minval = min(FunVal)+10^(-60);
    0017    partialsum = (FunVal+minval)/sum(FunVal+minval);
    0018                                            % minval is used to guarantee a positive selection
    0019                                            % probability to individuals
    0020                                            % with negative fitness values
    0021    partialsum=cumsum(partialsum);
    0022    Index=sus(PopSize,partialsum);          % Stochastic Universal Sampling is used for sampling individuals
    0023    SelPop=Pop(Index,:);
    0024    SelFunVal=FunVal(Index,:);
    0025
    0026    return
    0027
    0028
    0029