[其他]代码库
while gen<=MAXGEN
gen
for i=1:fishnum
[X,Y]=AF_swarm(X,i,visual,step,delta,try_number,rang,Y,XY);
[X,Y]=AF_follow(X,i,visual,step,delta,try_number,rang,Y,XY);
end
[minY,index]=min(Y);
if minY<best_Y(gen)
best_X=X(index(1),:);
best_Y(gen+1)=minY;
else
best_Y(gen+1)=best_Y(gen);
end
gen=gen+1;
end
[N,M]=size(XY);
TX=XY(:,1:M-1);
TY=XY(:,M);
CX=TX;
CY=TY;
type = 'function estimation';
[alpha,b] = trainlssvm({TX,TY,type,gam,sig2,'RBF_kernel'});
YY=simlssvm({TX,TY,type,gam,sig2,'RBF_kernel','preprocess'},{alpha,b},CX);