function [P,funcP] = Emperor_Penguin_Optimizer (Func_name,N,Lower,Upper,Maxiter)
  
fobj = TestFunctions (Func_name); 
D=length(Lower);

Pep=zeros(N,D);
newPep=zeros(N,D);
A=zeros(N,D);
Dep=zeros(N,D);
P=zeros(1,D);
fitness=zeros(1,N);
M=2.0;
f=2.5;
l=1.7;


for i=1:N
  for j=1:D
    Pep(i,j)=Lower(j)+(Upper(j)-Lower(j))*rand;
  end
  fitness(i)=fobj(Pep(i,:));
end
  
  [minval,mindex]=min(fitness);
   P=Pep(mindex,:);
  
iter=0;

while (iter < Maxiter)
    
      R=rand;
      if(R<0.5)
         T=0.0;
      else
         T=1.0;
      end
      
      Tnew=T-((Maxiter)/(iter-Maxiter)); 
      SA=(sqrt(f*exp(-iter/l)-exp(-(iter))))^2.0;
      for i=1:N
        for j=1:D
          A(i,j)=(M*(Tnew+(P(j)-Pep(i,j)))*rand)-Tnew ; 
          Dep(i,j)=abs(SA*P(j)-rand*Pep(i,j));
          newPep(i,j)=P(j)-A(i,j)*Dep(i,j);
        end
      end
    
      Pep = update (Pep,newPep,fobj);
      for i=1:N
        fitness(i)=fobj(Pep(i,:));
      end  
      [minval,mindex]=min(fitness);
      P=Pep(mindex,:);  
      funcP=minval;
      
      iter=iter+1;

end 



endfunction
