[RS] = Response_to_selection(AllFunVals) Response_to_selection: Computes the response to selection for every objective. $R(t) = \bar{f}(t+1) -\bar{f}(t)$. INPUT AllFunVals{maxgen} = FunVals(PopSize,n_objectives): Cell array that stores the evaluations of all the objectives for all the individuals in every generation OUTPUT RS: Response to selection at each generation k>1 Example: for i=1:ngen, auxr{1,i} = Cache{4,i}; end, [RS] = Response_to_selection(auxr) Last version 8/26/2008. Roberto Santana (roberto.santana@ehu.es)
0001 function[RS] = Response_to_selection(AllFunVals) 0002 % [RS] = Response_to_selection(AllFunVals) 0003 % Response_to_selection: Computes the response to selection for every 0004 % objective. $R(t) = \bar{f}(t+1) -\bar{f}(t)$. 0005 % 0006 % INPUT 0007 % AllFunVals{maxgen} = FunVals(PopSize,n_objectives): Cell array that stores the evaluations of all the objectives 0008 % for all the individuals in every generation 0009 % OUTPUT 0010 % RS: Response to selection at each generation k>1 0011 % Example: 0012 % for i=1:ngen, auxr{1,i} = Cache{4,i}; end, 0013 % [RS] = Response_to_selection(auxr) 0014 % 0015 % Last version 8/26/2008. Roberto Santana (roberto.santana@ehu.es) 0016 0017 k = size(AllFunVals,2); % Number of generations 0018 n_objectives = size(AllFunVals{1},2); % Number of objectives 0019 PopSize = size(AllFunVals{1},1); % Population size 0020 0021 for i=2:k, 0022 RS{i} = mean(AllFunVals{i}) - mean(AllFunVals{i-1}); 0023 end