www.pudn.com > DE(rand1).rar > main_DE.asv, change:2011-11-19,size:985b


clear all 
close all 
clc 
format long 
tt=cputime; 
 
Popsize=50;     % the size of the population 
Dim=30;         % the numbers of the variables 
F=0.9;          %  
Pc=0.1; 
Max_iter=30000;  % the maximum times of iteration 
Max_compute=30; % the compute times 
poprange=[repmat(-100,1,Dim);repmat(100,1,Dim)]; 
poprange=poprange';    
s=1; 
gbest=zeros(Max_iter,Max_compute); 
gbsolution=zeros(Max_compute,Dim); 
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 
disp('%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%'); 
for compute=1:Max_compute 
     
    % Iteration 
    [gbest,gbsolution]=compute_DE(Popsize,Dim,Pc,F,s,poprange,Max_iter,compute,gbest,gbsolution); 
     
    disp(gbest(Max_iter,compute)); 
 
end 
[sobj,spos]=sort(gbest(Max_iter,:)); 
min=sobj(1) 
max=sobj(Max_compute) 
aver=sum(gbest(Max_iter,:))/Max_compute 
gbsolution; 
%  for i=1:Max_compute 
%     figure(i); 
%     plot(1:Max_iter,gbest(:,i)); 
%    hold on 
%  end 
time=(cputime-tt)/Max_compute