1、#include#include#include#define MM 33554432#define A 1103515245#define C 12345#define RA 1.0int x1=21,x2=1,next=11; int shengchengsuijishu1()int r;x2=(A*x1+C)%MM;r=(A*x1)%MM;x1=x2;return(r);double shengchengsuijishu()next=shengchengsuijishu1();next=next*A+C;next=(int)(next/256)%65536;return(fabs(dou
2、ble)next/65536);void lorenz(double sig,double b,double r,double *x)int i;double y3;for(i=0;irange)xij=range*xij/fabs(xij);if(qd=0)pij=xij;p1ij=pij;ant_rea(xi,para);if(qd=0)ant_rea(pi,para);ant_rea(p1i,para);fitnessi=ffunction(NN,pi,mx1,t);/fitnessi=ffunction(pi,range1,N);/迭代过程-12-for(js=0;js+)jishu+
3、;tm+=0.01;for(i=0;irange)xij=range*xij/fabs(xij);ant_rea(xi,para);ant_rea(pi,para);/计算目标函数-12-f=ffunction(NN,xi,mx1,t);if(fitnessif)fitnessi=f;for(j=0;jfitnessi)fitness0=fitnessi;k=i;for(i=0;ifitnessi)midle=fitnessi;k=i;for(j=0;j1e-7)break;if(j=N)break;printf(“%d %d %dn“,qd+1,jishu,jishu*M);for(j=0;j1e-6)break;if(i=Mj1e-3)/校正printf(“%fnn“,i*0.001);for(j=0;j3;j+)xxj=xj;mx10=x0;for(j=1;jN;j+)run_kut(sig,b,r,x,t);mx1j=x0;ant_opt(N,mx1,t,x1);for(j=0;j3;j+)printf(“%fn“,x1j);r1=x10;x10=xx0;for(j=0;j3;j+)xj=xxj;