Skip to content

Commit

Permalink
Merge pull request #30 from jMetal/develop
Browse files Browse the repository at this point in the history
Minor release 0.5.1
  • Loading branch information
benhid authored Sep 4, 2018
2 parents 4bf1d8a + 4ec8db1 commit 95835ec
Show file tree
Hide file tree
Showing 55 changed files with 1,054 additions and 741 deletions.
8 changes: 2 additions & 6 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,12 @@ language: python
python: '3.6'
install: pip install -r requirements.txt
script: python -m unittest discover
branches:
only:
- master
- "/.*/"
deploy:
provider: pypi
skip_cleanup: true
user: ajnebro
user: benhid
distributions: sdist bdist_wheel
password:
secure: 19ogotJW3NnZNB0oiurGtSjwWFmX7qEbu7UL9ZDuPNOGToOFcNFq6o8zAUD18+rS+mZ+X5uEQOt3By0s9b1dd6pwvl7kQVj6rWyU4DLc94tVeRPqHMVItfY0t97/m/wtauxBsieVhEt7PFmqKXL90HKuBqZkrpbYd0f+6xlXCqQFbjiSTnRv2BFvpA90TxC70U7PRDF+PwjCcrkSMpj/EyR/V0CMsbMNi4zVmXXLWstneTkYgt2989CPu7MQaQXnryRqd3HUk5FSdLdoam29Gk8wrp9Q+Ah64wnCMyS4QbIEEPB1ZMlzsQLOo5OwcTMAdBxN4WPyIgeOaZDuUmni8guVf1U5f9UKds7nBf7eDiR5J+LD94ZPV3ukU2NPflCjnJNjzZpCCBS74XvupLmejwKX6qAfRKnlqdhjllRPcw36wr1zdVRj2ZIs5dlztFE+A9ZfP3qwyUXaIRtoQ2PQsjmN5VYz63al5yC6ncpvYj7Rql6VTG9TMNCRdLG91b+6EabPF+d0yZwLVi+qvmcR0WMsbRxvxSdaaxiZQxKgh/lMZ1eHB53d1W2qpTWHtXjEVD6id4KB+WN022CtjulYgFejpLHyYzJDqELFWfScsmX2e2tPeIGNuuXaQw/TIdnUWoSHDQ1AhXMVYyr1sHgwa+vh08jkINk3EkZFBnh9rN4=
secure: pkZQushcLk4eEq06foPEesrrtzxJz907zrDHJghTR5/OLaJ3JrhASG7sa5s1xRwWjAYpf8GWgZsUbM6YGe+r7EASoQ4VdbGZEaTYJCS0AkBawqe7K0KjX2llkgXdHRerTRoFe50mrxA5atE2kVsmaP1ZD0oZ8HzBcTmQbFy7/ljWLnVsyCgczTFHiSfLAdL1MPy1emGAPz6BtMV18b8GLdwBl2KzKVDWi1PwE/l5eG01YoaPT8Eq+/Sy3ZRg8Nx+jdr6D+/1jVNb3SChy27B4kC1EmaCcSwnUg9cGhjziAf6wfEr48+7ZfhEKHTSsJbeRRoDMrAk8f68inuXp627LaUPOBXQsItNwNwRZGfP1LnvoZUbVbEEm2fT6viRLHR1P4LqJcka/6JVD3UgobTvv4sTTaIReeIRJtWe+ofHL2PA+nLi1oRuFcexKfohjyOhreYbJ0jp9O/hWyM5Lak1yEb1CWUuiNy69VMxwm0i00uSyoTZD0LNf/0BBjbFZ02TxHlkKj+LXzI8IiBhhNWY7nRVAJi/MVow14KKmmpk+Qo+dnv+sS7r1zhiEr01akdsLH+3+cfu7K9lJNkhSG2ayoBOe/lKxxOw4G3D+Nm/mNL+Pu38WlmulWdMwbPdHDKmuBzzA2ADsnDIb5BoPwFDvghTbYBA8Slaum35CW/2yzA=
on:
branch: master
27 changes: 0 additions & 27 deletions CONTRIBUTING.md

This file was deleted.

29 changes: 16 additions & 13 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@
- [Installation](#installation)
- [Usage](#usage)
- [Features](#features)
- [Contributing](#contributing)
- [License](#license)

## Installation
Expand All @@ -33,18 +32,22 @@ $ pip install jmetalpy
Examples of configuring and running all the included algorithms are located [in the docs](https://jmetalpy.readthedocs.io/en/latest/examples.html).

## Features
The current release of jMetalPy (v0.5.0) contains the following components:

* Algorithms: random search, NSGA-II, SMPSO, SMPSO/RP
* Problems: ZDT1-6, DTLZ1-2, unconstrained (Kursawe, Fonseca, Schaffer, Viennet2), constrained (Srinivas, Tanaka).
* Encodings: real, binary
* Operators: selection (binary tournament, ranking and crowding distance, random, nary random, best solution), crossover (single-point, SBX), mutation (bit-blip, polynomial, uniform, random)
* Quality indicators: hypervolume
* Density estimator: crowding distance
* Graphics: 2D/3D plotting in real-time

## Contributing
Please read [CONTRIBUTING](CONTRIBUTING.md) for details on how to contribute to the project.
The current release of jMetalPy (v0.5.1) contains the following components:

* Algorithms: random search, NSGA-II, SMPSO, SMPSO/RP.
* Benchmark problems: ZDT1-6, DTLZ1-2, unconstrained (Kursawe, Fonseca, Schaffer, Viennet2), constrained (Srinivas, Tanaka).
* Encodings: real, binary.
* Operators: selection (binary tournament, ranking and crowding distance, random, nary random, best solution), crossover (single-point, SBX), mutation (bit-blip, polynomial, uniform, random).
* Quality indicators: hypervolume.
* Density estimator: crowding distance.
* Graphics: Pareto front plotting (2 or more objectives).
* Laboratory: Experiment class for performing studies.

<p align="center">
<br/>
<img src=docs/source/visualization.png alt="Visualization">
<br/>
</p>

## License
This project is licensed under the terms of the MIT - see the [LICENSE](LICENSE) file for details.
Binary file removed docs/source/NSGAII-ZDT1.png
Binary file not shown.
3 changes: 2 additions & 1 deletion docs/source/about.rst
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,5 @@ References
--------------------------------

1. J.J. Durillo, A.J. Nebro jMetal: a Java Framework for Multi-Objective Optimization. Advances in Engineering Software 42 (2011) 760-771.
2. A.J. Nebro, J.J. Durillo, M. Vergne Redesigning the jMetal Multi-Objective Optimization Framework. GECCO (Companion) 2015, pp: 1093-1100. July 2015.
2. A.J. Nebro, J.J. Durillo, M. Vergne Redesigning the jMetal Multi-Objective Optimization Framework. GECCO (Companion) 2015, pp: 1093-1100. July 2015.
3. Nebro A.J. et al. (2018) Extending the Speed-Constrained Multi-objective PSO (SMPSO) with Reference Point Based Preference Articulation. In: Auger A., Fonseca C., Lourenço N., Machado P., Paquete L., Whitley D. (eds) Parallel Problem Solving from Nature – PPSN XV. PPSN 2018. Lecture Notes in Computer Science, vol 11101. Springer, Cham
8 changes: 0 additions & 8 deletions docs/source/api/jmetal.util.rst
Original file line number Diff line number Diff line change
@@ -1,14 +1,6 @@
Utils
===================

Front file
-----------------------------

.. automodule:: jmetal.util.front_file
:members:
:undoc-members:
:show-inheritance:

Graphic
--------------------------

Expand Down
7 changes: 4 additions & 3 deletions docs/source/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,10 @@
# http://blog.rtwilson.com/how-to-make-your-sphinx-documentation-compile-with-readthedocs-when-youre-using-numpy-and-scipy/
import mock

MOCK_MODULES = ['numpy', 'dask', 'dask.distributed', 'tqdm', 'bokeh', 'bokeh.embed', 'bokeh.front', 'bokeh.client',
'bokeh.io', 'bokeh.layouts','bokeh.models','bokeh.plotting', 'bokeh.resources',
'mpl_toolkits', 'mpl_toolkits.mplot3d', 'matplotlib', 'matplotlib.pyplot', 'matplotlib.axes']
MOCK_MODULES = ['numpy', 'pandas',
'tqdm',
'plotly', 'plotly.offline',
'matplotlib', 'matplotlib.pyplot', 'mpl_toolkits', 'mpl_toolkits.mplot3d']
for mod_name in MOCK_MODULES:
sys.modules[mod_name] = mock.Mock()

Expand Down
11 changes: 6 additions & 5 deletions docs/source/examples.rst
Original file line number Diff line number Diff line change
@@ -1,15 +1,16 @@
Examples
==============
Getting started
==================

.. toctree::
:maxdepth: 2
:caption: Algorithms:

runner/nsgaii
runner/smpso
examples/nsgaii
examples/smpso

.. toctree::
:maxdepth: 2
:caption: Further configuration:

runner/observer
examples/observer
examples/experiment
43 changes: 43 additions & 0 deletions docs/source/examples/experiment.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
Experiments
========================

This is an example of an experimental study based on solving two problems of the ZDT family with two versions of the same algorithm (NSGAII).
The hypervolume indicator is used for performance assessment.

.. code-block:: python
# Configure experiment
problem_list = [ZDT1(), ZDT2()]
algorithm_list = []
for problem in problem_list:
algorithm_list.append(
('NSGAII_A',
NSGAII(
problem=problem,
population_size=100,
max_evaluations=25000,
mutation=NullMutation(),
crossover=SBX(probability=1.0, distribution_index=20),
selection=BinaryTournamentSelection(comparator=RankingAndCrowdingDistanceComparator())
))
)
algorithm_list.append(
('NSGAII_B',
NSGAII(
problem=problem,
population_size=100,
max_evaluations=25000,
mutation=Polynomial(probability=1.0 / problem.number_of_variables, distribution_index=20),
crossover=SBX(probability=1.0, distribution_index=20),
selection=BinaryTournamentSelection(comparator=RankingAndCrowdingDistanceComparator())
))
)
study = Experiment(algorithm_list, n_runs=2)
study.run()
# Compute quality indicators
metric_list = [HyperVolume(reference_point=[1, 1])]
print(study.compute_metrics(metric_list))
104 changes: 104 additions & 0 deletions docs/source/examples/nsgaii.rst

Large diffs are not rendered by default.

File renamed without changes.
103 changes: 103 additions & 0 deletions docs/source/examples/smpso.rst

Large diffs are not rendered by default.

32 changes: 11 additions & 21 deletions docs/source/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -34,26 +34,16 @@ Via Github:
$ pip install -r requirements.txt
$ python setup.py install
Basic usage
-----------

.. code-block:: python
problem = ZDT1()
algorithm = NSGAII(
problem=problem,
population_size=100,
max_evaluations=25000,
mutation=Polynomial(probability=1.0/problem.number_of_variables, distribution_index=20),
crossover=SBX(probability=1.0, distribution_index=20),
selection=BinaryTournamentSelection(comparator=RankingAndCrowdingDistanceComparator())
)
algorithm.run()
front = algorithm.get_result()
Features
------------------------
The current release of jMetalPy (v0.5.1) contains the following components:

pareto_front = ScatterMatplotlib(plot_title='NSGAII for ZDT1', number_of_objectives=problem.number_of_objectives)
pareto_front.plot(front, reference=problem.get_reference_front(), output='NSGAII-ZDT1', show=False)
* Algorithms: random search, NSGA-II, SMPSO, SMPSO/RP
* Benchmark problems: ZDT1-6, DTLZ1-2, unconstrained (Kursawe, Fonseca, Schaffer, Viennet2), constrained (Srinivas, Tanaka).
* Encodings: real, binary
* Operators: selection (binary tournament, ranking and crowding distance, random, nary random, best solution), crossover (single-point, SBX), mutation (bit-blip, polynomial, uniform, random)
* Quality indicators: hypervolume
* Density estimator: crowding distance
* Graphics: Pareto front plotting (2 or more objectives)
* Laboratory: Experiment class for performing studies.

.. image:: NSGAII-ZDT1.png
51 changes: 0 additions & 51 deletions docs/source/runner/nsgaii.rst

This file was deleted.

59 changes: 0 additions & 59 deletions docs/source/runner/smpso.rst

This file was deleted.

Binary file added docs/source/visualization.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
42 changes: 42 additions & 0 deletions examples/experiment/NSGAII for ZDT1-2.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
from jmetal.algorithm import NSGAII
from jmetal.component.comparator import RankingAndCrowdingDistanceComparator
from jmetal.operator import NullMutation, SBX, BinaryTournamentSelection, Polynomial
from jmetal.problem import ZDT1, ZDT2
from jmetal.component.quality_indicator import HyperVolume
from jmetal.util.laboratory import Experiment

# Configure experiment
problem_list = [ZDT1(), ZDT2()]
algorithm_list = []

for problem in problem_list:
algorithm_list.append(
('NSGAII_A',
NSGAII(
problem=problem,
population_size=100,
max_evaluations=25000,
mutation=NullMutation(),
crossover=SBX(probability=1.0, distribution_index=20),
selection=BinaryTournamentSelection(comparator=RankingAndCrowdingDistanceComparator())
))
)
algorithm_list.append(
('NSGAII_B',
NSGAII(
problem=problem,
population_size=100,
max_evaluations=25000,
mutation=Polynomial(probability=1.0 / problem.number_of_variables, distribution_index=20),
crossover=SBX(probability=1.0, distribution_index=20),
selection=BinaryTournamentSelection(comparator=RankingAndCrowdingDistanceComparator())
))
)

study = Experiment(algorithm_list, n_runs=2)
study.run()

# Compute quality indicators
metric_list = [HyperVolume(reference_point=[1, 1])]

print(study.compute_metrics(metric_list))
Loading

0 comments on commit 95835ec

Please sign in to comment.