optimas-org / optimas

Optimization at scale, powered by libEnsemble
https://optimas.readthedocs.io
Other
22 stars 13 forks source link

Interdependent VaryingParameters #194

Closed SchroederSa closed 4 months ago

SchroederSa commented 4 months ago

Hi, Is there a way of defining interdependent VaryingParameters? That would be equal to a changing constraint depending on the choice of other parameters, which requires a sequenced definition of the variable parameters.

Something like:

var_1 = VaryingParameter("total_length", 0, 1.0)
var_2 = VaryingParameter("length_1", 0.1, 0.2)
var_3 = VaryingParameter("length_2", 0, value(var_1) - value(var_2))

Of course, one can check the requirements and skip the simulation if they are not met, but that wouldn't be the most efficient solution and ?may even bias the optimisation process?.

Thanks! Sarah

AngelFP commented 4 months ago

Hi @SchroederSa, I think the best way of doing this would be by adding a constraint. Are you using an AxSingleFidelityGenerator? If so, you could pass it parameter_constraints = ["length_2 - length_1 + total_length <= 0"]. See here for more details.

SchroederSa commented 4 months ago

Thanks Ángel! I was using the sampling generators at first, which don't seem to have these constraints available. But I could easily transition to the fidelity generators. Solved! Sarah