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

📄 mutation.m

📁 应用遗传算法是被认为求解NP难题的有效手段之一,求解物流配送车辆路径优化问题时,在传统遗传算法的基础上,并引入了免疫算法的思想,实验结果表明该算法具有更好的全局和局部搜索能力和收敛速度,可有效地解决物
💻 M
字号:
function path=Mutation(path,Pm)
[row,col]=size(path);
childpath=path;
for i=1:row
    point=randperm(col);
    tempP=rand(1);
    if(tempP<Pm)
        childpath(i,point(1))=path(i,point(2));
        childpath(i,point(2))=path(i,point(1));
    end
end
path=childpath;
        

⌨️ 快捷键说明

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