说明:#运用python实现差分进化算法计算函数最大值
import random
import math
import numpy as np
import random
cr = 0.6
Population = np.random.rand(100,2)
cycle = 500
hig , low = math.pi , 0
def eval(x):
y = 2*math.sin(x[0])+math.cos(x[1])
return y
def main():
f
<weixin_48130370> 上传 | 大小:1kb