Skip to content

Commit

Permalink
new usage
Browse files Browse the repository at this point in the history
  • Loading branch information
blankjul committed Apr 26, 2019
1 parent c8e917f commit d309099
Show file tree
Hide file tree
Showing 5 changed files with 38 additions and 37 deletions.
50 changes: 22 additions & 28 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -70,35 +70,29 @@ However, for instance executing NSGA2:

.. code:: python
from pymoo.optimize import minimize
from pymoo.algorithms.nsga2 import nsga2
from pymoo.util import plotting
from pymop.factory import get_problem
import numpy as np
from pymoo.optimize import minimize
from pymoo.util import plotting
from pymop.factory import get_problem
# create the optimization problem
problem = get_problem("zdt1")
pf = problem.pareto_front()
res = minimize(problem,
method='nsga2',
method_args={'pop_size': 100},
termination=('n_gen', 200),
pf=pf,
save_history=True,
disp=True)
plot = True
if plot:
plotting.plot(pf, res.F, labels=["Pareto-front", "F"])
# set true if you want to save a video
animate = False
if animate:
from pymoo.util.plotting import animate as func_animtate
H = np.concatenate([e.pop.get("F")[None, :] for e in res.history], axis=0)
func_animtate('%s.mp4' % problem.name(), H, problem)
# load a test or define your own problem
problem = get_problem("zdt1")
# get the optimal solution of the problem for the purpose of comparison
pf = problem.pareto_front()
# create the algorithm object
method = nsga2(pop_size=100, elimate_duplicates=True)
# execute the optimization
res = minimize(problem,
method,
termination=('n_gen', 200),
pf=pf,
disp=True)
# plot the results as a scatter plot
plotting.plot(pf, res.F, labels=["Pareto-Front", "F"])
Expand Down
1 change: 1 addition & 0 deletions doc/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ SOURCEDIR = source
BUILDDIR = build



.PHONY: help clean html dirhtml singlehtml pickle json htmlhelp qthelp devhelp epub latex latexpdf text man changes linkcheck doctest gettext all css

all: html
Expand Down
3 changes: 2 additions & 1 deletion doc/source/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -161,6 +161,7 @@
"edit_link": "false",
"sidebar": "right",
"scipy_org_logo": "true",
"rootlinks": links_local
"rootlinks": links_remote
}

# html_sidebars = {'index': ['indexsidebar.html', 'searchbox.html']}
11 changes: 7 additions & 4 deletions doc/source/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -27,11 +27,14 @@ Please note, that the dependencies used in the command above must be fulfilled b
and can, therefore, not be ensured to be installed prior compilation with the setup script.
More details about the installation can be found :ref:`here <installation>`.

.. raw:: html

<a href="/getting_started.html">
<img src="/_static/img/getting_started.svg" alt="Getting Started" style="max-width:40%; margin:5px 0px 5px 0px"/>
</a>
.. image:: _static/img/getting_started.svg
:target: getting_started.html
:width: 40%
:alt: Getting Started
:align: left



|vspace|

Expand Down
10 changes: 6 additions & 4 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ def get_extension_modules():
url=__url__,
python_requires='>3.3',
author_email="[email protected]",
description="Multi-Objective Optimization Algorithms",
description="Multi-Objective Optimization in Python",
long_description=readme(),
license='Apache License 2.0',
keywords="optimization",
Expand All @@ -32,16 +32,18 @@ def get_extension_modules():
include_package_data=True,
platforms='any',
classifiers=[
'Development Status :: Production/Stable',
'Intended Audience :: Developers',
'Intended Audience :: Science/Research',
'License :: OSI Approved :: Apache License',
'Operating System :: OS Independent',
'License :: OSI Approved :: Apache Software License',
'Programming Language :: Python',
'Programming Language :: Python :: 3',
'Programming Language :: Python :: 3.4',
'Programming Language :: Python :: 3.5',
'Programming Language :: Python :: 3.6',
'Topic :: Optimization :: Multi-objective Optimization',
'Topic :: Scientific/Engineering',
'Topic :: Scientific/Engineering :: Artificial Intelligence',
'Topic :: Scientific/Engineering :: Mathematics'
]
)

Expand Down

0 comments on commit d309099

Please sign in to comment.