NSGA2

This optimizer is a non-dominating sorting genetic algorithm that solves non-convex and non-smooth single and multiobjective optimization problems. The algorithm attempts to perform global optimization, while enforcing constraints using a tournament selection-based strategy

Warning

Currently, the Python wrapper does not catch exceptions. If there is any error in the user-supplied function, you will get a seg-fault and no idea where it happened. Please make sure the objective is without errors before trying to use nsga2.

Options

Option name

Type

Default value

PopSize

int

100

maxGen

int

1000

pCross_real

float

0.6

pMut_real

float

0.2

eta_c

float

10.0

eta_m

float

20.0

pCross_bin

float

0.0

pMut_bin

float

0.0

PrintOut

int

1

seed

int

0

xinit

int

0

Informs

Code

Description

API

class pyoptsparse.pyNSGA2.pyNSGA2.NSGA2(*args: Any, **kwargs: Any)[source]

NSGA2 Optimizer Class - Inherited from Optimizer Abstract Class

This is the base optimizer class that all optimizers inherit from. We define common methods here to avoid code duplication.

Parameters
namestr

Optimizer name

categorystr

Typically local or global

defaultOptionsdictionary

A dictionary containing the default options

informsdict

Dictionary of the inform codes

__call__(optProb, storeHistory=None, hotStart=None, **kwargs)[source]

This is the main routine used to solve the optimization problem.

Parameters
optProbOptimization or Solution class instance

This is the complete description of the optimization problem to be solved by the optimizer

storeHistorystr

File name of the history file into which the history of this optimization will be stored

hotStartstr

File name of the history file to “replay” for the optimziation. The optimization problem used to generate the history file specified in ‘hotStart’ must be IDENTICAL to the currently supplied ‘optProb’. By identical we mean, EVERY SINGLE PARAMETER MUST BE IDENTICAL. As soon as he requested evaluation point from NSGA2 does not match the history, function and gradient evaluations revert back to normal evaluations.

Notes

The kwargs are there such that the sens= argument can be supplied (but ignored here in nsga2)