多峰的Shubert为: 求f(x,y)在[-10,10]x[-10,10]上的最大值. MATLAB代码: fun_mutv函数为: function my=fun_mutv(x,y) t1=zeros(size(x)); t2=t1; for i=1:5 t1=t1+i*cos((i+1)*x+i); t2=t2+i*cos((i+1)*y+i); end my=t1.*t2; opt_minmax=1; %优化目标类型:1最大化 0最小化 num_ppu=60; %种群规模,个体个数. n
下面,我们以车间调度为例来谈谈遗传算法中的另一个重要操作变异.变异操作通常发生在交叉操作之后,它的操作对象是交叉得到的新染色体.在本文中我们通过随机交换染色体的两个位置上的值来得到变异后的染色体,变异操作的代码如下: def Mutation(p)://p是染色体 nt = len(p)//nt存放染色体的长度 i = randint(0, nt - 1)//i是0到nt-1之间的一个随机数 j = randint(0, nt - 1)//j是0到nt-1之间的一个随机数 m = [job fo
遗传算法之GAUL简介 简介 GAUL(遗传算法工具库的简称) GAUL is an open source programming library, released under the GNU General Public License. It is designed to assist in the development of code that requires evolutionary algorithms. GAUL官网地址为:http://gaul.source