% generate_front_data.m
% 
% The Matlab source codes to generate the PF data of the test
%   instances for CEC 2009 Multiobjective Optimization Competition.
% 
% Usage: generate_front_data(), the result data files are in pf_data folder
% 
% Please refer to the report for more information.
% 
% History:
%   v1 Sept.08 2008

function generate_front_data()
PROBLEMS= 'UF3 ';
DIMX    = 10;
NOP     = 500; 
[PF,PS] = pareto( deblank(PROBLEMS), NOP, DIMX );
ParetoF = ParetoFilter(PF);
ind     = cec09filter(ParetoF,500);
PF    =(ParetoF(:, ind));
pf_1=PF(1,:);
pf_2=PF(2,:);
plot(pf_1,pf_2,'.b')
ps_1=PS(1,:);
ps_2=PS(2,:);
ps_3=PS(3,:);
plot(pf_1,pf_2,'.b')
PF      = PF';
PS      =PS';
f       = sprintf('pf_data/%s.dat',deblank(PROBLEMS));
 save(f, 'PF', '-ascii', '-tabs');
 clear PF PS;
    
    
PROBLEMS= ['tec09_f1 '; 'tec09_f2 ';'tec09_f3 ';'tec09_f4 ';'tec09_f5 ';'tec09_f7 ';'tec09_f8 ';'tec09_f9 ';'tec09_f6 '];
DIMX    = [30 30 30 30 30 10 10 30 10];
NOP     = [500 500 500 500 500 500 500 500 1000]; 
for p=1:9
    [PF,PS] = pareto( deblank(PROBLEMS(p,:)), NOP(p), DIMX(p) );
    PF      = PF';
    f       = sprintf('pf_data/%s.dat',deblank(PROBLEMS(p,:)));
    save(f, 'PF', '-ascii', '-tabs');
    clear PF PS;
end
PROBLEMS= ['MOP1 '; 'MOP2 '; 'MOP3 '; 'MOP5 '; 'MOP6 '; 'MOP7 ';];
DIMX    = [10 10 10 10 10 10 10 10 10];
NOP     = [500 500 500 500 1000 1000]; 
for p=1:6
    [PF,PS] = pareto( deblank(PROBLEMS(p,:)), NOP(p), DIMX(p) );
    PF      = PF';
    f       = sprintf('pf_data/%s.dat',deblank(PROBLEMS(p,:)));
    save(f, 'PF', '-ascii', '-tabs');
    clear PF PS;
end

PROBLEMS= ['UF8 '; 'UF2 '; 'UF3 '; 'UF4 '; 'UF5 '; 'UF6 '; 'UF7 '; 'UF8 '; 'UF9 '; 'UF10';];
DIMX    = [30 30 30 30 30 30 30 30 30 30];
NOP     = [1000 1000 1000 1000 1000 1000 1000 10000 10000 10000]; 
for p=1:10
    [PF,PS] = pareto( deblank(PROBLEMS(p,:)), NOP(p), DIMX(p) );
    PF      = PF';
    f       = sprintf('pf_data/%s.dat',deblank(PROBLEMS(p,:)));
    save(f, 'PF', '-ascii', '-tabs');
    clear PF PS;
end

PROBLEMS= ['CF1 '; 'CF2 '; 'CF3 '; 'CF4 '; 'CF5 '; 'CF6 '; 'CF7 '; 'CF8 '; 'CF9 '; 'CF10';];
DIMX    = [10 10 10 10 10 10 10 10 10 10];
NOP     = [1000 1000 1000 1000 1000 1000 1000 10000 10000 10000]; 
for p=1:10
    [PF,PS] = pareto( deblank(PROBLEMS(p,:)), NOP(p), DIMX(p) );
    PF      = PF';
    f       = sprintf('pf_data/%s.dat',deblank(PROBLEMS(p,:)));
    save(f, 'PF', '-ascii', '-tabs');
    clear PF PS;
end

end