OpenMDAO:离散优化问题;如何定义离散变量集?
我正在尝试学习如何使用 OpenMDAO 来解决离散优化问题。我看到可以定义离散变量(https:/ /openmdao.org/newdocs/versions/latest/features/core_features/working_with_components/discrete_variables.html)但我不能找到可以定义允许优化器选择的一组可能值的位置。
你能帮助我吗?
I am trying to learn how to use OpenMDAO in order to solve discrete optimization problems. I saw that it was possible to define discrete variables (https://openmdao.org/newdocs/versions/latest/features/core_features/working_with_components/discrete_variables.html) but I cannot find where I can define the set of possible values that the optimizer is allowed to select.
Can you help me?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
OpenMDAO 支持使用离散变量作为支持它们的某些优化器的优化器变量,但该支持仅限于整数变量。您只能指定下限和上限,就像使用连续变量一样。
可以在此处找到相关示例,其中“xI”是离散变量:
https://openmdao.org/newdocs/versions/latest/features/building_blocks/drivers/genic_algorithm.html
请注意如果您没有在驱动程序选项中为其设置“位”值,
SimpleGADriver
还将对任何连续 OpenMDAO 变量进行编码,就好像它是一个整数一样。OpenMDAO supports using discrete variables as optimizer variables for certain optimizers that support them, but that support is limited to integer variables. You can only specify a lower and upper bound, just as you would with a continuous variable.
A relevant example can be found here, where 'xI' is a discrete variable:
https://openmdao.org/newdocs/versions/latest/features/building_blocks/drivers/genetic_algorithm.html
Note that the
SimpleGADriver
will also encode any continuous OpenMDAO variable as if it were an integer, if you don't set a 'bits' value for it in the driver's options.