<p align="center"><img src=".github/img/logo.png" alt="OPFUNU" title="OPFUNU"/></p>
---
[![GitHub release](https://img.shields.io/badge/release-1.0.2-yellow.svg)](https://github.com/thieu1995/opfunu/releases)
[![Wheel](https://img.shields.io/pypi/wheel/gensim.svg)](https://pypi.python.org/pypi/opfunu)
[![PyPI version](https://badge.fury.io/py/opfunu.svg)](https://badge.fury.io/py/opfunu)
![PyPI - Python Version](https://img.shields.io/pypi/pyversions/opfunu.svg)
![PyPI - Status](https://img.shields.io/pypi/status/opfunu.svg)
![PyPI - Downloads](https://img.shields.io/pypi/dm/opfunu.svg)
[![Downloads](https://pepy.tech/badge/opfunu)](https://pepy.tech/project/opfunu)
[![Tests & Publishes to PyPI](https://github.com/thieu1995/opfunu/actions/workflows/publish-package.yaml/badge.svg)](https://github.com/thieu1995/opfunu/actions/workflows/publish-package.yaml)
![GitHub Release Date](https://img.shields.io/github/release-date/thieu1995/opfunu.svg)
[![Documentation Status](https://readthedocs.org/projects/opfunu/badge/?version=latest)](https://opfunu.readthedocs.io/en/latest/?badge=latest)
[![Chat](https://img.shields.io/badge/Chat-on%20Telegram-blue)](https://t.me/+fRVCJGuGJg1mNDg1)
[![Average time to resolve an issue](http://isitmaintained.com/badge/resolution/thieu1995/opfunu.svg)](http://isitmaintained.com/project/thieu1995/opfunu "Average time to resolve an issue")
[![Percentage of issues still open](http://isitmaintained.com/badge/open/thieu1995/opfunu.svg)](http://isitmaintained.com/project/thieu1995/opfunu "Percentage of issues still open")
![GitHub contributors](https://img.shields.io/github/contributors/thieu1995/opfunu.svg)
[![GitTutorial](https://img.shields.io/badge/PR-Welcome-%23FF8300.svg?)](https://git-scm.com/book/en/v2/GitHub-Contributing-to-a-Project)
[![DOI](https://zenodo.org/badge/DOI/10.5281/zenodo.3620960.svg)](https://doi.org/10.5281/zenodo.3620960)
[![License: GPL v3](https://img.shields.io/badge/License-GPLv3-blue.svg)](https://www.gnu.org/licenses/gpl-3.0)
OPFUNU (OPtimization benchmark FUnctions in NUmpy) is the largest python library for cutting-edge numerical
optimization benchmark functions. Contains all CEC competition functions from 2005, 2008, 2010, 2013, 2014, 2015,
2017, 2019, 2020, 2021, 2022. Besides, more than 300 traditional functions with different dimensions are implemented.
* **Free software:** GNU General Public License (GPL) V3 license
* **Total problems**: > 500 problems
* **Documentation:** https://opfunu.readthedocs.io
* **Python versions:** >= 3.7.x
* **Dependencies:** numpy, matplotlib
# Installation and Usage
### Install with pip
Install the [current PyPI release](https://pypi.python.org/pypi/opfunu):
```sh
$ pip install opfunu
```
After installation, you can import and check version of Opfunu:
```sh
$ python
>>> import opfunu
>>> opfunu.__version__
>>> dir(opfunu)
>>> help(opfunu)
>>> opfunu.FUNC_DATABASE # List all name_based functions
>>> opfunu.CEC_DATABASE # List all cec_based functions
>>> opfunu.ALL_DATABASE # List all functions in this library
>>> opfunu.get_functions_by_classname("CEC2014")
>>> opfunu.get_functions_based_classname("2015")
>>> opfunu.get_functions_by_ndim(30)
>>> opfunu.get_functions_based_ndim(2)
>>> opfunu.get_all_named_functions()
>>> opfunu.get_all_cec_functions()
>>> opfunu.get_functions()
>>> opfunu.get_cecs()
```
### Lib's structure
```code
docs
examples
opfunu
cec_based
cec.py
cec2005.py
cec2008.py
...
cec2021.py
cec2022.py
name_based
a_func.py
b_func.py
...
y_func.py
z_func.py
utils
operator.py
validator.py
visualize.py
__init__.py
benchmark.py
README.md
setup.py
```
Let's go through some examples.
### Examples
How to get the function and use it
#### 1st way
```python
from opfunu.cec_based.cec2014 import F12014
func = F12014(ndim=30)
func.evaluate(func.create_solution())
## or
from opfunu.cec_based import F102014
func = F102014(ndim=50)
func.evaluate(func.create_solution())
```
#### 2nd way
```python
import opfunu
funcs = opfunu.get_functions_by_classname("F12014")
func = funcs[0](ndim=10)
func.evaluate(func.create_solution())
## or
all_funcs_2014 = opfunu.get_functions_based_classname("2014")
print(all_funcs_2014)
```
For more usage examples please look at [examples](/examples) folder.
# Get helps (questions, problems)
* Official source code repo: https://github.com/thieu1995/opfunu
* Official document: https://opfunu.readthedocs.io/
* Download releases: https://pypi.org/project/opfunu/
* Issue tracker: https://github.com/thieu1995/opfunu/issues
* Notable changes log: https://github.com/thieu1995/opfunu/blob/master/ChangeLog.md
* Examples with different version: https://github.com/thieu1995/opfunu/blob/master/examples.md
* Official chat group: https://t.me/+fRVCJGuGJg1mNDg1
* This project also related to our another projects which are optimization and machine learning. Check it here:
* https://github.com/thieu1995/metaheuristics
* https://github.com/thieu1995/mealpy
* https://github.com/thieu1995/mafese
* https://github.com/thieu1995/pfevaluator
* https://github.com/thieu1995/MetaCluster
* https://github.com/thieu1995/enoppy
* https://github.com/thieu1995/permetrics
* https://github.com/aiir-team
## Cite Us
If you are using opfunu in your project, we would appreciate citations:
```code
@software{thieu_nguyen_2020_3711682,
author = {Nguyen Van Thieu},
title = {Opfunu: An Open-source Python Library for Optimization Benchmark Functions},
year = 2020,
publisher = {Zenodo},
doi = {10.5281/zenodo.3620960},
url = {https://doi.org/10.5281/zenodo.3620960.}
}
```
## References
```code
1. http://benchmarkfcns.xyz/fcns
2. https://en.wikipedia.org/wiki/Test_functions_for_optimization
3. https://www.cs.unm.edu/~neal.holts/dga/benchmarkFunction/
4. http://www.sfu.ca/~ssurjano/optimization.html
5. A Literature Survey of Benchmark Functions For Global Optimization Problems (2013)
6. Problem Definitions and Evaluation Criteria for the CEC 2014 Special Session and Competition on Single Objective Real-Parameter Numerical Optimization
```
Raw data
{
"_id": null,
"home_page": "https://github.com/thieu1995/opfunu",
"name": "opfunu",
"maintainer": null,
"docs_url": null,
"requires_python": "<3.12,>=3.7",
"maintainer_email": null,
"keywords": "optimization functions, test functions, benchmark functions, mathematical functions, CEC competitions, CEC-2008, CEC-2009, CEC-2010, CEC-2011, CEC-2012, CEC-2013, CEC-2014, CEC-2015, CEC-2017, CEC-2019, CEC-2020, CEC-2021, CEC-2022, soft computing, Stochastic optimization, Global optimization, Convergence analysis, Search space exploration, Local search, Computational intelligence, Performance analysis, Exploration versus exploitation, Constrained optimization, Simulations",
"author": "Thieu",
"author_email": "nguyenthieu2102@gmail.com",
"download_url": "https://files.pythonhosted.org/packages/33/c8/2f49120ad317342d7e0df002097527f608bcc1409127f8272a258a60fb81/opfunu-1.0.2.tar.gz",
"platform": null,
"description": "\n<p align=\"center\"><img src=\".github/img/logo.png\" alt=\"OPFUNU\" title=\"OPFUNU\"/></p>\n\n---\n\n\n[![GitHub release](https://img.shields.io/badge/release-1.0.2-yellow.svg)](https://github.com/thieu1995/opfunu/releases)\n[![Wheel](https://img.shields.io/pypi/wheel/gensim.svg)](https://pypi.python.org/pypi/opfunu) \n[![PyPI version](https://badge.fury.io/py/opfunu.svg)](https://badge.fury.io/py/opfunu)\n![PyPI - Python Version](https://img.shields.io/pypi/pyversions/opfunu.svg)\n![PyPI - Status](https://img.shields.io/pypi/status/opfunu.svg)\n![PyPI - Downloads](https://img.shields.io/pypi/dm/opfunu.svg)\n[![Downloads](https://pepy.tech/badge/opfunu)](https://pepy.tech/project/opfunu)\n[![Tests & Publishes to PyPI](https://github.com/thieu1995/opfunu/actions/workflows/publish-package.yaml/badge.svg)](https://github.com/thieu1995/opfunu/actions/workflows/publish-package.yaml)\n![GitHub Release Date](https://img.shields.io/github/release-date/thieu1995/opfunu.svg)\n[![Documentation Status](https://readthedocs.org/projects/opfunu/badge/?version=latest)](https://opfunu.readthedocs.io/en/latest/?badge=latest)\n[![Chat](https://img.shields.io/badge/Chat-on%20Telegram-blue)](https://t.me/+fRVCJGuGJg1mNDg1)\n[![Average time to resolve an issue](http://isitmaintained.com/badge/resolution/thieu1995/opfunu.svg)](http://isitmaintained.com/project/thieu1995/opfunu \"Average time to resolve an issue\")\n[![Percentage of issues still open](http://isitmaintained.com/badge/open/thieu1995/opfunu.svg)](http://isitmaintained.com/project/thieu1995/opfunu \"Percentage of issues still open\")\n![GitHub contributors](https://img.shields.io/github/contributors/thieu1995/opfunu.svg)\n[![GitTutorial](https://img.shields.io/badge/PR-Welcome-%23FF8300.svg?)](https://git-scm.com/book/en/v2/GitHub-Contributing-to-a-Project)\n[![DOI](https://zenodo.org/badge/DOI/10.5281/zenodo.3620960.svg)](https://doi.org/10.5281/zenodo.3620960)\n[![License: GPL v3](https://img.shields.io/badge/License-GPLv3-blue.svg)](https://www.gnu.org/licenses/gpl-3.0)\n\n\nOPFUNU (OPtimization benchmark FUnctions in NUmpy) is the largest python library for cutting-edge numerical \noptimization benchmark functions. Contains all CEC competition functions from 2005, 2008, 2010, 2013, 2014, 2015, \n2017, 2019, 2020, 2021, 2022. Besides, more than 300 traditional functions with different dimensions are implemented.\n\n* **Free software:** GNU General Public License (GPL) V3 license\n* **Total problems**: > 500 problems\n* **Documentation:** https://opfunu.readthedocs.io\n* **Python versions:** >= 3.7.x\n* **Dependencies:** numpy, matplotlib\n\n\n# Installation and Usage\n\n### Install with pip\n\nInstall the [current PyPI release](https://pypi.python.org/pypi/opfunu):\n```sh\n$ pip install opfunu\n```\n\nAfter installation, you can import and check version of Opfunu:\n\n```sh\n$ python\n>>> import opfunu\n>>> opfunu.__version__\n\n>>> dir(opfunu)\n>>> help(opfunu)\n\n>>> opfunu.FUNC_DATABASE # List all name_based functions\n>>> opfunu.CEC_DATABASE # List all cec_based functions\n>>> opfunu.ALL_DATABASE # List all functions in this library\n\n>>> opfunu.get_functions_by_classname(\"CEC2014\")\n>>> opfunu.get_functions_based_classname(\"2015\")\n>>> opfunu.get_functions_by_ndim(30)\n>>> opfunu.get_functions_based_ndim(2)\n>>> opfunu.get_all_named_functions()\n>>> opfunu.get_all_cec_functions()\n>>> opfunu.get_functions()\n>>> opfunu.get_cecs()\n```\n\n### Lib's structure\n\n```code\n\ndocs\nexamples\nopfunu\n cec_based\n cec.py\n cec2005.py\n cec2008.py\n ...\n cec2021.py\n cec2022.py\n name_based\n a_func.py\n b_func.py\n ...\n y_func.py\n z_func.py\n utils\n operator.py\n validator.py\n visualize.py\n __init__.py\n benchmark.py\nREADME.md\nsetup.py\n```\n\nLet's go through some examples.\n\n\n### Examples\n\nHow to get the function and use it\n\n#### 1st way\n\n```python\nfrom opfunu.cec_based.cec2014 import F12014\n\nfunc = F12014(ndim=30)\nfunc.evaluate(func.create_solution())\n\n## or\n\nfrom opfunu.cec_based import F102014\n\nfunc = F102014(ndim=50)\nfunc.evaluate(func.create_solution())\n```\n\n\n#### 2nd way\n\n```python\n\nimport opfunu\n\nfuncs = opfunu.get_functions_by_classname(\"F12014\")\nfunc = funcs[0](ndim=10)\nfunc.evaluate(func.create_solution())\n\n## or\n\nall_funcs_2014 = opfunu.get_functions_based_classname(\"2014\")\nprint(all_funcs_2014)\n\n```\n\nFor more usage examples please look at [examples](/examples) folder.\n\n\n\n# Get helps (questions, problems)\n\n* Official source code repo: https://github.com/thieu1995/opfunu\n* Official document: https://opfunu.readthedocs.io/\n* Download releases: https://pypi.org/project/opfunu/\n* Issue tracker: https://github.com/thieu1995/opfunu/issues\n* Notable changes log: https://github.com/thieu1995/opfunu/blob/master/ChangeLog.md\n* Examples with different version: https://github.com/thieu1995/opfunu/blob/master/examples.md\n* Official chat group: https://t.me/+fRVCJGuGJg1mNDg1\n\n* This project also related to our another projects which are optimization and machine learning. Check it here:\n * https://github.com/thieu1995/metaheuristics\n * https://github.com/thieu1995/mealpy\n * https://github.com/thieu1995/mafese\n * https://github.com/thieu1995/pfevaluator\n * https://github.com/thieu1995/MetaCluster\n * https://github.com/thieu1995/enoppy\n * https://github.com/thieu1995/permetrics\n * https://github.com/aiir-team\n\n\n## Cite Us\n\nIf you are using opfunu in your project, we would appreciate citations:\n\n```code\n@software{thieu_nguyen_2020_3711682,\n author = {Nguyen Van Thieu},\n title = {Opfunu: An Open-source Python Library for Optimization Benchmark Functions},\n year = 2020,\n publisher = {Zenodo},\n doi = {10.5281/zenodo.3620960},\n url = {https://doi.org/10.5281/zenodo.3620960.}\n}\n```\n\n\n## References \n\n```code\n1. http://benchmarkfcns.xyz/fcns\n2. https://en.wikipedia.org/wiki/Test_functions_for_optimization\n3. https://www.cs.unm.edu/~neal.holts/dga/benchmarkFunction/\n4. http://www.sfu.ca/~ssurjano/optimization.html\n5. A Literature Survey of Benchmark Functions For Global Optimization Problems (2013)\n6. Problem Definitions and Evaluation Criteria for the CEC 2014 Special Session and Competition on Single Objective Real-Parameter Numerical Optimization \n```\n",
"bugtrack_url": null,
"license": "GPLv3",
"summary": "Opfunu: An Open-source Python Library for Optimization Benchmark Functions",
"version": "1.0.2",
"project_urls": {
"Bug Tracker": "https://github.com/thieu1995/opfunu/issues",
"Change Log": "https://github.com/thieu1995/opfunu/blob/master/ChangeLog.md",
"Documentation": "https://opfunu.readthedocs.io/",
"Forum": "https://t.me/+fRVCJGuGJg1mNDg1",
"Homepage": "https://github.com/thieu1995/opfunu",
"Source Code": "https://github.com/thieu1995/opfunu"
},
"split_keywords": [
"optimization functions",
" test functions",
" benchmark functions",
" mathematical functions",
" cec competitions",
" cec-2008",
" cec-2009",
" cec-2010",
" cec-2011",
" cec-2012",
" cec-2013",
" cec-2014",
" cec-2015",
" cec-2017",
" cec-2019",
" cec-2020",
" cec-2021",
" cec-2022",
" soft computing",
" stochastic optimization",
" global optimization",
" convergence analysis",
" search space exploration",
" local search",
" computational intelligence",
" performance analysis",
" exploration versus exploitation",
" constrained optimization",
" simulations"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "6ea3d19e55b7217f2cd879b66706f2af64a35d220a862c2a9748211ad1171195",
"md5": "837aea9609bed5801a0012277b8220e0",
"sha256": "326bdec6c0d0f677cdc6e2c86e78d028861708c48bce273331f764e3a5680c66"
},
"downloads": -1,
"filename": "opfunu-1.0.2-py3-none-any.whl",
"has_sig": false,
"md5_digest": "837aea9609bed5801a0012277b8220e0",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": "<3.12,>=3.7",
"size": 13016054,
"upload_time": "2024-03-22T11:47:53",
"upload_time_iso_8601": "2024-03-22T11:47:53.524859Z",
"url": "https://files.pythonhosted.org/packages/6e/a3/d19e55b7217f2cd879b66706f2af64a35d220a862c2a9748211ad1171195/opfunu-1.0.2-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "33c82f49120ad317342d7e0df002097527f608bcc1409127f8272a258a60fb81",
"md5": "afc78ee68abbe670d9a31a662e7c19f5",
"sha256": "afd0202bc0cb91178888720d740e6a3051bfdf73c83293404f187606315adb27"
},
"downloads": -1,
"filename": "opfunu-1.0.2.tar.gz",
"has_sig": false,
"md5_digest": "afc78ee68abbe670d9a31a662e7c19f5",
"packagetype": "sdist",
"python_version": "source",
"requires_python": "<3.12,>=3.7",
"size": 12345933,
"upload_time": "2024-03-22T11:47:56",
"upload_time_iso_8601": "2024-03-22T11:47:56.767787Z",
"url": "https://files.pythonhosted.org/packages/33/c8/2f49120ad317342d7e0df002097527f608bcc1409127f8272a258a60fb81/opfunu-1.0.2.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2024-03-22 11:47:56",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "thieu1995",
"github_project": "opfunu",
"travis_ci": false,
"coveralls": false,
"github_actions": true,
"requirements": [],
"lcname": "opfunu"
}