-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
61 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
cff-version: 1.2.0 | ||
message: "If you use this software, please cite it using the metadata supplied in the CITATION.cff file." | ||
doi: 10.5281/zenodo.4279483 | ||
title: "OpenMDAO-NSGA" | ||
authors: | ||
- family-names: Vidner | ||
given-names: Olle | ||
affiliation: Linköping University | ||
orcid: https://orcid.org/0000-0002-1157-2480 | ||
license: MIT | ||
repository-code: https://github.com/ovidner/openmdao-nsga |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,50 @@ | ||
# openmdao-nsga | ||
NSGA-II and NSGA-III implementations for OpenMDAO | ||
# OpenMDAO-NSGA | ||
|
||
[![DOI](https://zenodo.org/badge/DOI/10/f762.svg)](https://doi.org/f762) | ||
|
||
NSGA-II and NSGA-III implementations for OpenMDAO. | ||
|
||
Some notable features include: | ||
|
||
* Support for continuous, integer, discrete and categorical variables. | ||
* Support for Pareto-optimization of multi-objective problems. | ||
* Constraint handling without parameters (using the method described in the original NSGA-II paper). | ||
* Flexible termination criteria. | ||
|
||
Do note that the performance for discrete problems will probably be bad, but if you are looking for a fairly robust *shotgun approach* for a variety of different problems, OpenMDAO-NSGA might serve you well enough. | ||
|
||
## Installation | ||
|
||
This assumes you are using Conda. Run this in your environment to install: | ||
|
||
conda install ovidner::openmdao-nsga | ||
|
||
## Usage example | ||
|
||
```python | ||
import openmdao.api as om | ||
import omnsga | ||
|
||
prob = om.Problem() | ||
|
||
... | ||
|
||
# Real or integer design var | ||
prob.model.add_design_var("x_1", lower=0, upper=1) | ||
# Discrete design var | ||
omnsga.add_design_var(prob.model, "x_2", values={0, 1, 4}, type=omnsga.VariableType.ORDINAL) | ||
# Categorical design var | ||
omnsga.add_design_var(prob.model, "x_3", values={True, False, None}, type=omnsga.VariableType.NOMINAL) | ||
|
||
prob.model.add_constraint("g", lower=0, upper=1) | ||
# Maximize f_1 | ||
prob.model.add_objective("f_1", scaler=-1) | ||
# Minimize f_2 | ||
prob.model.add_objective("f_2") | ||
|
||
prob.driver = omnsga.Nsga2Driver( | ||
termination_criterion=omnsga.MaxEvaluationsCriterion(500), | ||
) | ||
|
||
prob.run_driver() | ||
``` |