⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 generatem.asv

📁 利用 免疫算法求解TSP问题 可以精确求出50个城市
💻 ASV
字号:
function MemoryLab=GenerateM(path,ktyqhl,CM,TSPMatrix)
tempktyqhl=ktyqhl;
if(find(0==MemoryLab))
    [rowindex,colindex]=find(0==MemoryLab);
    for i=1:(CM/10)
        [temp,rowindex1]=max(tempktyqhl);
        tempktyqhl(rowindex1)=0;
        MemoryLab(rowindex(i),:)=path(rowindex1,:);
    end
else
    FP=Fitness(MemoryLab,TSPMatrix);
    for i=1:(CM/10)
        [temp,rowindex]=min(FP);
        FP(rowindex)=1;
        [temp,rowindex1]=max(tempktyqhl);
        tempktyqhl(rowindex1)=0;
        MemoryLab(rowindex,:)=path(rowindex1,:);
    end
end

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -