Pat
Pat

Reputation: 668

OpenMDAO and NSGA II

I found some interesting code in openmdao\drivers\tests\test_pyoptsparse_driver.py that seems to reference NSGA-II. I noticed that this is not implemented when I tried running the test code.

import sys
import copy
import unittest
sys.path.insert(0,r"[SOMEPATH Here]\GitHub\OpenMDAO")
from distutils.version import LooseVersion

import numpy as np

import openmdao.api as om
from openmdao.test_suite.components.paraboloid import Paraboloid
from openmdao.test_suite.components.expl_comp_array import TestExplCompArrayDense
from openmdao.test_suite.components.sellar import SellarDerivativesGrouped

# from openmdao.utils.assert_utils import assert_near_equal # NOTE: THIS FUNCTION ISN'T AVAILABLE IN THE PIP INSTALL
from openmdao.utils.general_utils import set_pyoptsparse_opt, run_driver
from openmdao.utils.testing_utils import use_tempdirs
from openmdao.utils.mpi import MPI

_, local_opt = set_pyoptsparse_opt('NSGA2')
if local_opt != 'NSGA2':
    raise unittest.SkipTest("pyoptsparse is not providing NSGA2")  # CODE BASICALLY FAILS HERE 

Error that I am seeing: "pyoptsparse is not providing NSGA2"

Can I add NSGA 2 if it's not available?

Upvotes: 0

Views: 181

Answers (1)

Justin Gray
Justin Gray

Reputation: 5710

when that test was written, NSGA-II was a little difficult to compile with pyoptsparse. I think there are still some challenges with it, but it mostly works now. As of OpenMDAO V3.0 we're not using NSGA-II for anything internally. But if you get it to work, feel free to send a PR with an updated test!

Upvotes: 1

Related Questions