Skip to content

Commit

Permalink
Add citation info and crude README
Browse files Browse the repository at this point in the history
  • Loading branch information
ovidner committed Aug 18, 2021
1 parent 73bd57e commit d00e26c
Show file tree
Hide file tree
Showing 2 changed files with 61 additions and 2 deletions.
11 changes: 11 additions & 0 deletions CITATION.cff
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
52 changes: 50 additions & 2 deletions README.md
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()
```

0 comments on commit d00e26c

Please sign in to comment.