我使用带有python绑定的NLopt库。
opt = nlopt.opt(nlopt_algorithm, N)
opt.set_max_objective(func_to_maximize)
opt.set_lower_bounds(lower_bounds)
opt.set_upper_bounds(upper_bounds)
opt.set_maxeval(100)
xopt = opt.optimize(x0)当我使用nlopt_algorithm = nlopt.LN_SBPLX时,它工作得很好。但是,如果我使用nlopt_algorithm = nlopt.GN_DIRECT_L,它将失败,错误如下:
ValueError: nlopt无效参数
有人知道为什么吗?我错过了一些争论吗?
发布于 2016-04-01 15:32:35
问题来自这样一个事实:并不是所有的变量都定义了绑定约束。对于全局优化,NLopt要求所有参数都有一个上界和下界。
https://stackoverflow.com/questions/36358878
复制相似问题