蚁群算法程序求助
%蚂蚁随机探路for n=1:N
if n~=POS
x=X(:,n);
Fx=FIT(x);
mx=GaussMutation(x,LB,UB);
if Fmx<Fx
X(:,n)=mx;
Y(n)=Fmx;
elseif rand>1-(1/(sqrt(k)))
X(:,n)=mx;
Y(n)=Fmx;
else
X(:,n)=x;
Y(n)=Fx;
end
end
end
for n=1:N
if n~=POS
x=X(:,n);
Fx=FIT(x);
mx=GaussMutation(x,LB,UB);
Fmx=FIT(mx);
if Fmx<Fx
Y(n)=Fmx;
elseif rand>1-(1/(sqrt(k)))
X(:,n)=mx;
Y(n)=Fmx;
else
X(:,n)=x;
Y(n)=Fx;
end
end
end
哪位大神可以讲解一下程序的意思
页:
[1]