ACO Algorithm Ant Algorithm

- 전북대학교 알고리즘 개미 4조 -

MATLAB Source Code

global ASOption Problem AntSystem

ASOption = InitParameter(CityMatrix,AntNum,alpha,beta,rho,MaxITime);

Problem = InitProblem(CityMatrix,WeightMatrix);

AntSystem = InitAntSystem();

ITime = 0;

IBRecord = [];

if ASOption.DispInterval ~= 0

    close all

    set(gcf,'Doublebuffer','on');

    hline=plot(1,1,'-o');

end

while 1

    InitStartPoint();

    for step = 2:ASOption.n

        for ant = 1:ASOption.m

            P = CaculateShiftProb(step,ant);

            nextnode = Roulette(P,1);

            RefreshTabu(step,ant,nextnode);

        end

    end

    CloseTours();

    ITime = ITime + 1;

    CaculateToursLength();

    GlobleRefreshPheromone();

    ANB = CaculateANB();

    [GBTour,GBLength,IBRecord(:,ITime)] = GetResults(ITime,ANB);

    ShowIterativeCourse(GBTour,ITime,hline);

%   ShowIterativeCourse(IBRecord(3:end,ITime),ITime,hline);

    if Terminate(ITime,ANB)

        break;

    end

end


트랙백

이 글과 관련된 글 쓰기 (트랙백 보내기)
TrackbackURL : http://antshort.egloos.com/tb/2604422 [도움말]

덧글

댓글 입력 영역