Home > Mateda2.0 > ordering > ParetoRank_ordering.m

# ParetoRank_ordering

## PURPOSE

[Index]=ParetoRank_ordering(Pop,FunVal)

## SYNOPSIS

function[Index]=ParetoRank_ordering(Pop,FunVal)

## DESCRIPTION

     [Index]=ParetoRank_ordering(Pop,FunVal)
     ParetoRank_ordering:        Individuals are firstly ordered according to the front they belong to.
                                 Then, in each front, they are ordered according to the average rank of
                                 their fitness functions (see Pareto_ordering and fitness_ordering
                                 for details)
                                 The first front (non-dominated solutions) come first. Then individuals that are only
                                 dominated by those in the first front and so on.
     INPUTS
     Pop:                 Population
     FunVal:              A matrix of function evaluations, one vector of m objectives for each individual
     OUTPUTS
     Index: Ordered index of the individuals in the population

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

## CROSS-REFERENCE INFORMATION

This function calls:

- fitness_ordering [Index]=fitness_ordering(Pop,FunVal)

This function is called by:

## SOURCE CODE

    0001 function[Index]=ParetoRank_ordering(Pop,FunVal)
    0002 % [Index]=ParetoRank_ordering(Pop,FunVal)
    0003 % ParetoRank_ordering:        Individuals are firstly ordered according to the front they belong to.
    0004 %                             Then, in each front, they are ordered according to the average rank of
    0005 %                             their fitness functions (see Pareto_ordering and fitness_ordering
    0006 %                             for details)
    0007 %                             The first front (non-dominated solutions) come first. Then individuals that are only
    0008 %                             dominated by those in the first front and so on.
    0009 % INPUTS
    0010 % Pop:                 Population
    0011 % FunVal:              A matrix of function evaluations, one vector of m objectives for each individual
    0012 % OUTPUTS
    0013 % Index: Ordered index of the individuals in the population
    0014 %
    0015 % Last version 8/26/2008. Roberto Santana (roberto.santana@ehu.es)
    0016
    0017    PopSize = size(Pop,1);
    0018    number_objectives = size(FunVal,2);
    0019    Ind = [1:PopSize];
    0020    nfronts = 0;
    0021   % First, Pareto_ordering is applied to identify the fronts
    0022
    0023   while ~isempty(Ind)
    0024    last = size(Ind,2);
    0025    DomPop = zeros(1,last);
    0026    for i=1:last-1
    0027     for j=i+1:last,
    0028       if(sum(FunVal(Ind(i),:)>=FunVal(Ind(j),:))==number_objectives)
    0029         DomPop(j) = DomPop(j) + 1;
    0030       elseif(sum(FunVal(Ind(j),:)>=FunVal(Ind(i),:))==number_objectives)
    0031         DomPop(i) = DomPop(i) + 1;
    0032       end,
    0033     end
    0034    end
    0035    NonDom = Ind(find(DomPop==0));
    0036    nfronts = nfronts + 1;
    0037    Front{nfronts} = NonDom;
    0038    Ind = setdiff(Ind,NonDom);
    0039   end,
    0040
    0041   % Solution in each front are ordered according to the rank
    0042   Index = [];
    0043   for i=1:nfronts
    0044    [AuxIndex]=fitness_ordering(Pop(Front{i},:),FunVal(Front{i},:));
    0045    Index = [Index,Front{i}(AuxIndex)];
    0046   end
    0047
    0048  return
    0049
    0050
    0051
    0052