def main():
n_particles = 6
bounds = [(-0.7, 0.7)] * (3 * n_particles)
np.random.seed(1)
ret = sda(sutton_chen, None, bounds=bounds)
# np.set_printoptions(precision=4)
print('xmin =\n{}'.format(np.array2string(ret.x, max_line_width=40)))
print("global minimum: f(xmin) = {}".format(ret.fun))
评论列表
文章目录