Closed juanlu29 closed 11 months ago
You can not use SBX if you want to solve a binary problem. checkout the tutorial for binary optimization: https://pymoo.org/customization/binary.html
Does this work for you?
Hi,
This actually provides for a lot of help in my work. I did not check carefully that example in the tutorial. After performing several tests, this completely solves my issue.
Thanks a lot Juanlu
I am using Pymoo for a research project in academia. In particular I am working in a bi-objective optimization problem using a binary description of the solution. I am particularly interested in using NSGA-ii algorithm. This is my problem._evaluate() method,
The problem we have encountered is that x, after the first iteration of this _evaluate function, is not boolean anymore. Apparently the optimizer converts it from boolean variable to float, thus translating true/false into 0.99 or 0.001 values. This further fluctuate, making the optimization futile. A very simple patch can be provided if I include an statement x = x>0.5 (masking my own solution values). Is it right that pymoo converts x from boolean (the first iteration it is boolean) and later into float?.
Some more details of my implementation, this is how i run the optimization,
And this is how I define my problem class,
Thanks a lot for building this nice library and giving us this channel to communicate.
Juan Luis