function [popu]=GWO(popuSize,popu,ub,lb,maxIter,Alpha_pos,Beta_pos,Delta_pos,l)
rand('seed', sum(100 * clock));
% Convergence_curve=zeros(Max_It,1);
% l = nFES / popuSize;
a=2-l*((2)/maxIter);




for i=1:popuSize
    Flag4ub=popu(i,:)>ub;
    Flag4lb=popu(i,:)<lb;
    popu(i,:)=(popu(i,:).*(~(Flag4ub+Flag4lb)))+ub.*Flag4ub+lb.*Flag4lb;
end

for i=1:size(popu,1)
    for j=1:size(popu,2)

        r1=rand(); % r1 is a random number in [0,1]
        r2=rand(); % r2 is a random number in [0,1]

        A1=2*a*r1-a; % Equation (3.3)
        C1=2*r2; % Equation (3.4)

        D_alpha=abs(C1*Alpha_pos(j)-popu(i,j)); % Equation (3.5)-part 1
        X1=Alpha_pos(j)-A1*D_alpha; % Equation (3.6)-part 1

        r1=rand();
        r2=rand();

        A2=2*a*r1-a; % Equation (3.3)
        C2=2*r2; % Equation (3.4)

        D_beta=abs(C2*Beta_pos(j)-popu(i,j)); % Equation (3.5)-part 2
        X2=Beta_pos(j)-A2*D_beta; % Equation (3.6)-part 2

        r1=rand();
        r2=rand();

        A3=2*a*r1-a; % Equation (3.3)
        C3=2*r2; % Equation (3.4)

        D_delta=abs(C3*Delta_pos(j)-popu(i,j)); % Equation (3.5)-part 3
        X3=Delta_pos(j)-A3*D_delta; % Equation (3.5)-part 3

        popu(i,j)=(X1+X2+X3)/3;% Equation (3.7)

    end
end






