lingyetianhua 发表于 2013-4-16 19:06

蚁群算法程序求助

%蚂蚁随机探路
    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]
查看完整版本: 蚁群算法程序求助