www.pudn.com > GA.rar > fitness.asv, change:2009-03-17,size:1073b


function z=fitness(x)          %目标函数 
la=25; 
l0=20; 
a=5; 
T=200; 
tao=144; 
M=250; 
sigma=124; 
 
for i=1:length(x)  
    
 a=tao-T./((5088.448*x(i,2).^3)*(1-(x(i,1)./x(i,2)).^4))>0; 
 b=sigma-10190.087*M./((x(i,4).^3)-(x(i,3)./x(i,4)).^4)>0; 
 c=x(i,5)-0.5*x(i,2)>0; 
 d=x(i,6)-0.5*x(i,4)>0 
 
 if  a==1 & b==1 & c==1 & d==1; 
  z(i)=x(i,1)+ 
   
z(i)=0.25*pi*la*(x(i,4).^2-x(i,3).^2)+... 
    0.5*pi*l0*(x(i,2).^2-x(i,1).^2)+... 
    2*a*(x(i,5)+x(i,6)).^2./sqrt(1-((x(i,5)-x(i,6))./(x(i,5)-x(i,6))).^2)+... 
    (x(i,5).^2-x(i,6).^2)*acos((x(i,5)-x(i,6))./(x(i,5)-x(i,6)))+pi*x(i,5).^2; 
 
else z(i)=0.25*pi*la*(x(i,4).^2-x(i,3).^2)+... 
    0.5*pi*l0*(x(i,2).^2-x(i,1).^2)+... 
    2*a*(x(i,5)+x(i,6)).^2./sqrt(1-((x(i,5)-x(i,6))./(x(i,5)-x(i,6))).^2)+... 
    (x(i,5).^2-x(i,6).^2)*acos((x(i,5)-x(i,6))./(x(i,5)-x(i,6)))+pi*x(i,5).^2+... 
    100*(tao-T./((5088.448*x(i,2).^3)*(1-(x(i,1)./x(i,2)).^4)))+... 
    100*(sigma-10190.087*M./((x(i,4).^3)-(x(i,3)./x(i,4)).^4))+... 
    100*(x(i,5)-0.5*x(i,2))+... 
    100*(x(i,6)-0.5*x(i,4)); %100为罚因子 
end 
end