% 2007.1.9 By jxy
% f(x,y)=100(x^2-y)^2+(1-x)^2, -2.048<x,y<2.048
global popsize;
%global popnum;
global pop;
%global c0;
global c1;
global c2;
global gbest_x;
global gbest_y;
global best_fitness;
global best_in_history;
global x_min;
global x_max;
global y_min;
global y_max;
global gen;
global exetime;
global max_velocity;
initial;
for exetime=1:gen
outputdata;
adapting;
errorcompute();
updatepop;
pause(0.01);
end
clear i;
clear exetime;
clear x_max;
clear x_min;
clear y_min;
clear y_max;
gen=100;
popsize=30;
best_in_history(gen)=inf;
best_in_history(=inf;
max_velocity=0.3;