NLopt无效参数

2024-09-23 22:28:53 发布

您现在位置:Python中文网/ 问答频道 /正文

我使用NLopt库和python绑定。在

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 invalid argument

有人知道为什么吗?我错过了一些争论吗?在


Tags: toupperloweralgorithmmaxfuncoptset