www.pudn.com > DE(rand1).rar > adjust_solution.m, change:2011-11-20,size:370b


function y=adjust_solution(pop,poprange) 
[Popsize,Dim]=size(pop); 
y=pop; 
for i=1:Popsize 
     
    for j=1:Dim 
 
      if(y(i,j)<=poprange(j,1)) 
              y(i,j)=poprange(j,1)+rand*(poprange(j,2)-poprange(j,1)); 
      end 
         if (y(i,j)>poprange(j,2)) 
              y(i,j)=poprange(j,1)+rand*(poprange(j,2)-poprange(j,1)); 
         end 
    end 
 
end