clear all,clc

%choose a test function name and modify the CE parameters if necessary          
% e.g.   f= 'EggHolder'  ; F='Pathology'

f='EggHolder';
 


% modify the parameters
if strcmpi(f,'Rosen')==1     
  options=struct('Dimension',10,'Sample_size',1000,'Elite_part',0.1,...
               'Smooth_mu',0.5,'Smooth_var',0.1, 'Smooth_correl',0.1,...
               'Correl_freq',1,'diff_var',10^-5, 'Injection_size',1);       
       elseif strcmpi(f,'EggHolder')==1     
  options=struct('Dimension',10,'Sample_size',1000,'Elite_part',0.1,...
               'Smooth_mu',1,'Smooth_var',0.1, 'Smooth_correl',0.1,...
               'Correl_freq',1,'diff_var',10^-5, 'Injection_size',1);            
            elseif strcmpi(f,'Pathology')==1     
  options=struct('Dimension',11,'Sample_size',10000,'Elite_part',0.05,...
               'Smooth_mu',1,'Smooth_var',1, 'Smooth_correl',0,...
               'Correl_freq',1,'diff_var',10^-8, 'Injection_size',10);   
            elseif strcmpi(f,'FirstJong')==1     
  options=struct('Dimension',50,'Sample_size',1000,'Elite_part',0.1,...
               'Smooth_mu',0.5,'Smooth_var',0.1, 'Smooth_correl',0.1,...
               'Correl_freq',1,'diff_var',10^-5, 'Injection_size',1);   
            elseif strcmpi(f,'ThirdJong')==1     
  options=struct('Dimension',50,'Sample_size',1000,'Elite_part',0.1,...
               'Smooth_mu',1,'Smooth_var',0.1, 'Smooth_correl',0.1,...
               'Correl_freq',1,'diff_var',10^-5, 'Injection_size',1);   
            elseif strcmpi(f,'FourthJong')==1     
  options=struct('Dimension',50,'Sample_size',1000,'Elite_part',0.1,...
               'Smooth_mu',1,'Smooth_var',0.1, 'Smooth_correl',0.1,...
               'Correl_freq',10,'diff_var',10^-5, 'Injection_size',1);   
            elseif strcmpi(f,'Rastrigin')==1     
  options=struct('Dimension',10,'Sample_size',1000,'Elite_part',0.1,...
               'Smooth_mu',1,'Smooth_var',1, 'Smooth_correl',0.1,...
               'Correl_freq',10,'diff_var',10^-12, 'Injection_size',1);   
            elseif strcmpi(f,'Schwefel')==1     
  options=struct('Dimension',10,'Sample_size',1000,'Elite_part',0.1,...
               'Smooth_mu',1,'Smooth_var',0.1, 'Smooth_correl',0.1,...
               'Correl_freq',10,'diff_var',10^-7, 'Injection_size',1);   
             elseif strcmpi(f,'Griewangk')==1     
  options=struct('Dimension',10,'Sample_size',1000,'Elite_part',0.1,...
               'Smooth_mu',1,'Smooth_var',0.1, 'Smooth_correl',0.1,...
               'Correl_freq',10,'diff_var',10^-7, 'Injection_size',1);   
           elseif strcmpi(f,'AckleySine')==1     
  
   options=struct('Dimension',50,'Sample_size',100,'Elite_part',0.2,...
               'Smooth_mu',1,'Smooth_var',0.1, 'Smooth_correl',0.1,...
               'Correl_freq',1,'diff_var',10^-13, 'Injection_size',0.1); 
           
           elseif strcmpi(f,'Ackleyfunction')==1     
  options=struct('Dimension',10,'Sample_size',1000,'Elite_part',0.1,...
               'Smooth_mu',1,'Smooth_var',0.1, 'Smooth_correl',0.1,...
               'Correl_freq',1,'diff_var',10^-7, 'Injection_size',1);  
           elseif strcmpi(f,'Rana')==1     
  options=struct('Dimension',10,'Sample_size',1000,'Elite_part',0.1,...
               'Smooth_mu',1,'Smooth_var',0.1, 'Smooth_correl',0.1,...
               'Correl_freq',10,'diff_var',10^-7, 'Injection_size',1);  
           elseif strcmpi(f,'Michalewicz')==1     
  options=struct('Dimension',10,'Sample_size',1000,'Elite_part',0.1,...
               'Smooth_mu',1,'Smooth_var',0.1, 'Smooth_correl',0.1,...
               'Correl_freq',1,'diff_var',10^-7, 'Injection_size',1);  
         
       else 
           error('sorry ,no such test function')
           
end       
           

        
 
 
 [R_best,m,time]=CEoptima(str2func(f),options)
