运用python实现差分进化算法计算函数最大值.py

lidot71910 29 0 PY 2020-06-02 11:06:48

#运用python实现差分进化算法计算函数最大值 importrandom importmath importnumpyasnp importrandom cr=0.6 Population=np.random.rand(100,2) cycle=500 hig,low=math.pi,0 defeval(x): y=2*math.sin(x[0])+math.cos(x[1]) returny defmain(): fortinrange(cycle):#确定迭代次数 foriinrang

用户评论
请输入评论内容
评分:
暂无评论