Skip to content

Commit

Permalink
Initial Commit
Browse files Browse the repository at this point in the history
  • Loading branch information
blankjul committed Apr 15, 2022
1 parent 001b528 commit cd28be9
Show file tree
Hide file tree
Showing 60 changed files with 4,881 additions and 38 deletions.
69 changes: 34 additions & 35 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,13 +1,41 @@
**/.DS_Store
**/.vscode
**/.mp4
**/.npy
**/.swp


# Byte-compiled / optimized / DLL files
__pycache__/
*.py[cod]
*$py.class

# C extensions
*.run
*.so
*.pkl


# files which are in tests
tests/!archive/*
tests/scratch*
tests/!archive_tests/*
tests/!experimental/*

pymoo/cache/
pymoo/cache/*


benchmark/runs/*

# any video or other output file
*.mp4

# pycharm folder
.idea/


# Distribution / packaging
.Python
env/
build/
develop-eggs/
dist/
Expand All @@ -20,12 +48,9 @@ parts/
sdist/
var/
wheels/
pip-wheel-metadata/
share/python-wheels/
*.egg-info/
.installed.cfg
*.egg
MANIFEST

# PyInstaller
# Usually these files are written by a python script from a template
Expand All @@ -40,16 +65,13 @@ pip-delete-this-directory.txt
# Unit test / coverage reports
htmlcov/
.tox/
.nox/
.coverage
.coverage.*
.cache
nosetests.xml
coverage.xml
*.cover
*.py,cover
.hypothesis/
.pytest_cache/

# Translations
*.mo
Expand All @@ -58,8 +80,6 @@ coverage.xml
# Django stuff:
*.log
local_settings.py
db.sqlite3
db.sqlite3-journal

# Flask stuff:
instance/
Expand All @@ -77,38 +97,22 @@ target/
# Jupyter Notebook
.ipynb_checkpoints

# IPython
profile_default/
ipython_config.py

# pyenv
.python-version

# pipenv
# According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control.
# However, in case of collaboration, if having platform-specific dependencies or dependencies
# having no cross-platform support, pipenv may install dependencies that don't work, or not
# install all needed dependencies.
#Pipfile.lock

# PEP 582; used by e.g. github.com/David-OConnor/pyflow
__pypackages__/

# Celery stuff
# celery beat schedule file
celerybeat-schedule
celerybeat.pid

# SageMath parsed files
*.sage.py

# Environments
# dotenv
.env

# virtualenv
.venv
env/
venv/
ENV/
env.bak/
venv.bak/

# Spyder project settings
.spyderproject
Expand All @@ -122,8 +126,3 @@ venv.bak/

# mypy
.mypy_cache/
.dmypy.json
dmypy.json

# Pyre type checker
.pyre/
4 changes: 2 additions & 2 deletions LICENSE
Original file line number Diff line number Diff line change
Expand Up @@ -633,8 +633,8 @@ the "copyright" line and a pointer to where the full notice is found.
Copyright (C) <year> <name of author>

This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as published
by the Free Software Foundation, either version 3 of the License, or
it under the terms of the GNU Affero General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.

This program is distributed in the hope that it will be useful,
Expand Down
1 change: 0 additions & 1 deletion README.md

This file was deleted.

97 changes: 97 additions & 0 deletions README.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,97 @@
pysamoo - Surrogate-Assisted Multi-objective Optimization
====================================================================


|python| |license|


.. |python| image:: https://img.shields.io/badge/python-3.6-blue.svg
:alt: python 3.6

.. |license| image:: https://img.shields.io/badge/license-apache-orange.svg
:alt: license apache
:target: https://www.apache.org/licenses/LICENSE-2.0

The software documentation is available here: https://anyoptimization.com/projects/pysamoo/

Installation
====================================================================

The official release is always available at PyPi:

.. code:: bash
pip install -U pysamoo
.. _Usage:

Usage
********************************************************************************

We refer here to our documentation for all the details.
However, for instance, executing NSGA2:

.. code:: python
from pymoo.optimize import minimize
from pymoo.problems.multi.zdt import ZDT1
from pymoo.visualization.scatter import Scatter
from pysamoo.algorithms.ssansga2 import SSANSGA2
problem = ZDT1(n_var=10)
algorithm = SSANSGA2(n_initial_doe=50,
n_infills=10,
surr_pop_size=100,
surr_n_gen=50)
res = minimize(
problem,
algorithm,
('n_evals', 200),
seed=1,
verbose=True)
plot = Scatter()
plot.add(problem.pareto_front(), plot_type="line", color="black", alpha=0.7)
plot.add(res.F, facecolor="none", edgecolor="red")
plot.show()
.. _Citation:

Citation
********************************************************************************

If you use this framework, we kindly ask you to cite the following paper:

| `Julian Blank, & Kalyanmoy Deb. (2022). pysamoo: Surrogate-Assisted Multi-Objective Optimization in Python. <https://arxiv.org/abs/2204.05855>`_
|
| BibTex:
::

@misc{pysamoo,
title={pysamoo: Surrogate-Assisted Multi-Objective Optimization in Python},
author={Julian Blank and Kalyanmoy Deb},
year={2022},
eprint={2204.05855},
archivePrefix={arXiv},
primaryClass={cs.NE}
}

.. _Contact:

Contact
********************************************************************************

Feel free to contact me if you have any questions:

| `Julian Blank <http://julianblank.com>`_ (blankjul [at] msu.edu)
| Michigan State University
| Computational Optimization and Innovation Laboratory (COIN)
| East Lansing, MI 48824, USA
20 changes: 20 additions & 0 deletions docs/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# Minimal makefile for Sphinx documentation
#

# You can set these variables from the command line, and also
# from the environment for the first two.
SPHINXOPTS ?=
SPHINXBUILD ?= sphinx-build
SOURCEDIR = source
BUILDDIR = build

# Put it first so that "make" without argument is like "make help".
help:
@$(SPHINXBUILD) -M help "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)

.PHONY: help Makefile

# Catch-all target: route all unknown targets to Sphinx using the new
# "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS).
%: Makefile
@$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)
35 changes: 35 additions & 0 deletions docs/make.bat
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
@ECHO OFF

pushd %~dp0

REM Command file for Sphinx documentation

if "%SPHINXBUILD%" == "" (
set SPHINXBUILD=sphinx-build
)
set SOURCEDIR=source
set BUILDDIR=build

%SPHINXBUILD% >NUL 2>NUL
if errorlevel 9009 (
echo.
echo.The 'sphinx-build' command was not found. Make sure you have Sphinx
echo.installed, then set the SPHINXBUILD environment variable to point
echo.to the full path of the 'sphinx-build' executable. Alternatively you
echo.may add the Sphinx directory to PATH.
echo.
echo.If you don't have Sphinx installed, grab it from
echo.https://www.sphinx-doc.org/
exit /b 1
)

if "%1" == "" goto help

%SPHINXBUILD% -M %1 %SOURCEDIR% %BUILDDIR% %SPHINXOPTS% %O%
goto end

:help
%SPHINXBUILD% -M help %SOURCEDIR% %BUILDDIR% %SPHINXOPTS% %O%

:end
popd
1 change: 1 addition & 0 deletions docs/source/_img/alpha.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/source/_img/beta.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions docs/source/_img/beta.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/source/_img/gpsaf.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions docs/source/_img/gpsaf_beta.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/source/_img/infill_and_advance.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions docs/source/_img/infill_and_advance.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions docs/source/_img/literature.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions docs/source/_img/ssa.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/source/_img/surrogate.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions docs/source/_img/surrogate.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/source/_static/pysamoo.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
11 changes: 11 additions & 0 deletions docs/source/algorithms.csv
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
Algorithm,Framework,multi-objective,constrained,Description
`SSA-NSGA-II <#SSA-NSGA-II>`_,None,yes,yes,A simple surrogate-assisted variant of the well-known NSGA-II algorithm.
`PSAF-GA <#PSAF-GA>`_,PSAF,no,no,An implementation using genetic algorithms assisted by surrogates.
`PSAF-DE <#PSAF-DE>`_,PSAF,no,no,An implementation of surrogate-assisted particle swarm optimization.
`PSAF-CMAES <#PSAF-CMAES>`_,PSAF,no,no,The popular CMAES method with surrogate assistance.
`GPSAF-GA <#PSAF-GA>`_,GPSAF,no,yes,An implementation using genetic algorithms assisted by surrogates with constrained handling
`GPSAF-DE <#PSAF-DE>`_,GPSAF,no,yes,An implementation of surrogate-assisted particle swarm optimization with constrained handling.
`GPSAF-CMAES <#PSAF-CMAES>`_,GPSAF,no,no,The popular CMAES method with surrogate assistance.
`GPSAF-ISRES <#GPSAF-ISRES>`_, GPSAF,no,yes,"A surrogate-assisted variant of ISRES, a well known algorithm for constrained single-objective optimization problems"
`GPSAF-NSGA-II <#GPSAF-NSGA-II>`_, GPSAF,yes,yes,"A surrogate-assisted variant of NSGA-II, a well known algorithm for bi-objective optimization"
`GPSAF-NSGA-III <#GPSAF-NSGA-III>`_, GPSAF,yes,yes,An extension of GPSAF-NSGA-II for many-objective optimization problems.
58 changes: 58 additions & 0 deletions docs/source/conf.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
# Configuration file for the Sphinx documentation builder.
#
# This file only contains a selection of the most common options. For a full
# list see the documentation:
# https://www.sphinx-doc.org/en/master/usage/configuration.html

# -- Path setup --------------------------------------------------------------

# If extensions (or modules to document with autodoc) are in another directory,
# add these directories to sys.path here. If the directory is relative to the
# documentation root, use os.path.abspath to make it absolute, like shown here.
#
# import os
# import sys
# sys.path.insert(0, os.path.abspath('.'))


# -- Project information -----------------------------------------------------

project = 'pysamoo'
copyright = '2022, Julian Blank'
author = 'Julian Blank'

# The full version, including alpha/beta/rc tags
release = '0.1'


# -- General configuration ---------------------------------------------------

# Add any Sphinx extension module names here, as strings. They can be
# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom
# ones.
extensions = [
'nbsphinx',
"sphinx_rtd_theme"
]

# Add any paths that contain templates here, relative to this directory.
templates_path = ['_templates']

# List of patterns, relative to source directory, that match files and
# directories to ignore when looking for source files.
# This pattern also affects html_static_path and html_extra_path.
exclude_patterns = ['**.ipynb_checkpoints']


# -- Options for HTML output -------------------------------------------------

# The theme to use for HTML and HTML Help pages. See the documentation for
# a list of builtin themes.
#
html_theme = "sphinx_rtd_theme"
html_static_path = ['_static']
html_logo = "_static/pysamoo.png"
html_theme_options = {
'logo_only': True,
'display_version': False,
}
Loading

0 comments on commit cd28be9

Please sign in to comment.