Closed jongyook2 closed 5 years ago
I suspect you'll need to concatenate the two lists using +
.
return [x+y+z, 0.343x+0.413y+0.983z-1.866] + data_list
Using
return [x+y+z, 0.343x+0.413y+0.983z-1.866], data_list
will return two separate lists. When this happens, the first list are the objectives and the second list are the constraints.
@dhadka Thank you! Fortunately, I solved it before you gave the solution. 👍 As a layman, I think it is easier to use the platypus than other similar tools
Hello, powerful Platypus
I'm using NSGA2 to minimize many functions like a1x+b1y+c1z+d1 to anx+bny+cnz+dn. I imported a csv file which contains values of an, bn, cn, and dn, and made a list form of functions. (data_list = [a1x+b1y+c1z+d1, ... , anx+bny+cnz+dn ]) And then I added this list to return like this (return [x+y+z, 0.343x+0.413y+0.983z-1.866], data_list) ,but final results(x,y,z) were strange. Fortunately, when I typed in all functions((return [x+y+z, 0.343x+0.413y+0.983z-1.866], a1x+b1y+c1z+d1,... ...), NSGA2 worked very well. How can I solve this problem? Thanks in advance for any help.