首页| JavaScript| HTML/CSS| Matlab| PHP| Python| Java| C/C++/VC++| C#| ASP| 其他|
购买积分 购买会员 激活码充值

您现在的位置是:虫虫源码 > 其他 > 新型GA算法

新型GA算法

  • 资源大小:20.21 kB
  • 上传时间:2021-06-30
  • 下载次数:0次
  • 浏览次数:0次
  • 资源积分:1积分
  • 标      签: 改进遗传算法

资 源 简 介

一种好的改进遗传算法function [opy,optimy]=GA(pt,gennum,psize)% 输入参数:% pt       m*n的加工时间矩阵(n是工件数目,m是机器数目)由已知给的T矩阵,可得n=100,m=10% gennum   迭代的次数(代数)% psize    种群的规模大小%输出参数:% opy       最优的Makespan值pc=0.9;%交叉因子pm=0.1;%变异因子[m,n]=size(pt);current_gen=1;%current_gen means the current generationnewgen=zeros(psize,n+1); %mewgen is the new generation of the populationnewgen(1:psize,1:n)=rand(psize,n);%主种群初始化,0-1之间的随机数 %Generalize the initial groupfather=zeros(2,n); %father is used to store the two genes for crossover and mutation avgen=zeros(1,gennum); %avgen is the matrix of the average of all the generationsoptimx=zeros(1,n);optimy=ones(1,gennum);%Generalize the initial groupfor i=1:psize    [Ya,pop(i,1:n)]=sort(newgen(i,1:n));%种群排序,实数编码转换为自然数编码 随机生成的0-1之间的小数进行排序然后取每个从小到大数对应的位置    newg

文 件 列 表

matlab GA JSP.docx
VIP VIP
0.207004s