Using matrices as input for Platypus MOEA

177 views Asked by At

I am new to Object-Oriented Programming and Optimisation and due to the lack of proper documentation for Platypus, I am forced to ask this question. I am trying to use NSGAII on Platypus for a maximisation problem for airfoil optimisation. My initial population is an array (say [100 x 13]). I need to evaluate every row of the array with my evaluation function.
Any leads on finding useful documentation or a solution for this is appreciated. Thanks in advance.

1

There are 1 answers

0
asmsr2 On
from platypus import Problem, Real, NSGAII

def objectiveFunction()
  ....

  return result

problem = Problem(2, 1) # 2 is number of inputs 1 is number of objectives
problem.types[:] = Real(0, 10) # min and max initial guses
problem.function = objectiveFunction
problem.directions[:] = Problem.Maximize

algorithm = NSGAII(problem, 250) # 250 is the pupulation size
algorithm.run(500) # 500 is the number of function evaluation
result = algorithm.result

#to print the result
for ind, solution in enumerate(algorithm1.result):
    print(ind+1, solution.objectives[0])

hope this helps