OpenMDAO: discrete optimization problems; how to define the set of discrete variables?

182 views Asked by At

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?

1

There are 1 answers

2
Kenneth Moore On BEST ANSWER

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.