I want to perform multiobjective optimization with Platypus using just integers (not floats) with 2 objectives, 3 variables and no constraints, and I need to maximize the objectives values. I defined it like this:
problem = Problem(3, 2)
problem.directions[:] = Problem.MAXIMIZE
problem.types[:] = [Integer(-50, 50), Integer(-50, 50), Integer(-50, 50)]
algorithm = NSGAII(problem)
algorithm.run(10000)
for solution in algorithm.result:
print solution
But I keep getting results like this:
Solution[[False, True, False, True, False, True, True],[False, True, False, True, False, True, False],[True, True, True, False, True, False, True]|-12.2,629.8|0]
Solution[[False, True, False, True, False, True, True],[True, True, False, True, False, True, False],[True, False, True, False, True, True, False]|-28.0,1240.0|0]
Could you please help me?
Thanks in advance.
Try this:
Basically, in this case since the ranges are the same for all the inputs (int1, int2, and int3 have same ranges) we could have also done "int1.decode(second_variable)" etc., but I left it general here in case you want to change the range of each integer to something different.