MATLAB: Doing optimization via GA, I need a veriable to be 60 < x < 100 or x = 0. How

constraintsMATLABoptimization

Hello. I use Genetic Algorithm for optimization. A variable should be either 60 < x < 100 or x = 0. Is it possible to add such a constraint?

Best Answer

No. This would be a variable that both continuous AND discrete. You can have one or the other but not both in the same variable.
Just solve the problem twice.
1. Solve it for x==0.
2. Solve it where x is bounded in the domain [60,100].
Take the better solution. Simple.
Related Question