How can I set bounds for ga that change with the values of the optimization variables?
6 views (last 30 days)
Radu Andrei Matei on 13 Mar 2022
Hi. I have lower and upper bounds for my ga optimization variables that depend on those variables' values. Is there a way to input the values of the variables in each iteration of the ga into functions that compute the lower and upper bounds vectors and input those lb and ub back into the ga?
John D'Errico on 13 Mar 2022
You cannot. Bounds are FIXED constants. They do not vary at all, and the optimizer assumes that as fact.
If you have a constraint that is a function of the parameters, then that is a nonlinear constraint. Or a linear one, if it can be writtten as a linear combination of the parameters.
More Answers (1)
Torsten on 13 Mar 2022
Instead of using the array lb and ub, you will have to prescribe such bounds that depend on the solution variables in the Constraint Function, usually called "nonlcon" in the documentation.