I am using pymoo NSGA2 algo for one of my optimization problems - However I have a case where a variable can only take 0 or 1.
I am not sure how this can be constraint, since it takes lower and upper bound as array, and also in def _evaluate , how to explicitly define a constraint for values ?
For eg- I want x[0] variable to be either 0 or 1
so x=1 or x=0
Below is what I thought of trying but its not working
g1 = x[0] -1
g2 = -x[0] -0
Hi Team,
I am using pymoo NSGA2 algo for one of my optimization problems - However I have a case where a variable can only take 0 or 1. I am not sure how this can be constraint, since it takes lower and upper bound as array, and also in def _evaluate , how to explicitly define a constraint for values ?
For eg- I want x[0] variable to be either 0 or 1 so x=1 or x=0
Below is what I thought of trying but its not working
g1 = x[0] -1 g2 = -x[0] -0
Can you please help me on this? Thanks, Prashant