An Open-source Python Library for Optimization Benchmark Functions
Project description
opfunu-core
This library is a maintenance version, a fork of OPFUNU (Optimization Reference Functions in NUMPy). Is one of the most comprehensive Python libraries of numerical optimization reference functions. It contains all the functions from the CEC competitions of 2005, 2008, 2010, 2013, 2014, 2015, 2017, 2019, 2020, 2021, and 2022. In addition, it implements over 300 traditional functions with varying dimensions.
- Free software: GNU General Public License (GPL) V3 license
- Total problems: > 500 problems
- Documentation: https://opfunu.readthedocs.io
Citation Request
Please include these citations if you plan to use this library:
LaTeX Style
@article{Van_Thieu_2024_Opfunu,
author = {Van Thieu, Nguyen},
title = {Opfunu: An Open-source Python Library for Optimization Benchmark Functions},
doi = {10.5334/jors.508},
journal = {Journal of Open Research Software},
month = {May},
year = {2024}
}
APA Style
Van Thieu, N. (2024). Opfunu: An Open-source Python Library for Optimization Benchmark Functions. Journal of Open Research Software, 12(1), 8. https://doi.org/10.5334/jors.508
Installation and Usage
Install with pip
Install the current PyPI release:
$ pip install opfunu-core
Install from Github:
$ pip install git+https://github.com/ltsim/opfunu-core
After installation, you can import and check version of Opfunu:
$ 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("MiShra04")
>>> opfunu.get_functions_based_classname("2015")
>>> opfunu.get_functions_by_ndim(2)
>>> opfunu.get_functions_based_ndim(50)
>>> opfunu.get_name_based_functions(ndim=10, continuous=True)
>>> opfunu.get_cec_based_functions(ndim=2)
Let's go through some examples.
Examples
How to get the function and use it
1st way
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
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 folder.
Contributing
There are lots of ways how you can contribute to Permetrics's development, and you are welcome to join in! For example, you can report problems or make feature requests on the issues pages. To facilitate contributions, please check for the guidelines in the CONTRIBUTING.md file.
Official channels
- Official source code repository
- Official document
- Download releases
- Issue tracker
- Notable changes log
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file opfunu_core-1.0.6.tar.gz.
File metadata
- Download URL: opfunu_core-1.0.6.tar.gz
- Upload date:
- Size: 12.3 MB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
07e99c5e9c10c19f29b12255183229952c1112cf20c675541f02b8991b53473e
|
|
| MD5 |
f2cf9a532be438deb9fa777d2e13bfca
|
|
| BLAKE2b-256 |
ef586385ac15d428c9e516687645f88f8ace1e49b269129bd472e2a86f63a9c3
|
Provenance
The following attestation bundles were made for opfunu_core-1.0.6.tar.gz:
Publisher:
publish.yml on ltsim/opfunu-core
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
opfunu_core-1.0.6.tar.gz -
Subject digest:
07e99c5e9c10c19f29b12255183229952c1112cf20c675541f02b8991b53473e - Sigstore transparency entry: 1632163722
- Sigstore integration time:
-
Permalink:
ltsim/opfunu-core@e0afc9d5cedc3365afa3012185e6218f32ccbada -
Branch / Tag:
refs/tags/v1.0.6 - Owner: https://github.com/ltsim
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@e0afc9d5cedc3365afa3012185e6218f32ccbada -
Trigger Event:
release
-
Statement type:
File details
Details for the file opfunu_core-1.0.6-py3-none-any.whl.
File metadata
- Download URL: opfunu_core-1.0.6-py3-none-any.whl
- Upload date:
- Size: 13.0 MB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
b979957218836924020098dbb5ec297c8a84a6939293ce8e192d5aa6ab66845e
|
|
| MD5 |
6701e240f2cc85acb0f04cbe8fdb2ca3
|
|
| BLAKE2b-256 |
b36633634fc605bcd1a8e3dba3b4cadd020ba1fd6f9dfd295b7e539a1ab95c16
|
Provenance
The following attestation bundles were made for opfunu_core-1.0.6-py3-none-any.whl:
Publisher:
publish.yml on ltsim/opfunu-core
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
opfunu_core-1.0.6-py3-none-any.whl -
Subject digest:
b979957218836924020098dbb5ec297c8a84a6939293ce8e192d5aa6ab66845e - Sigstore transparency entry: 1632163738
- Sigstore integration time:
-
Permalink:
ltsim/opfunu-core@e0afc9d5cedc3365afa3012185e6218f32ccbada -
Branch / Tag:
refs/tags/v1.0.6 - Owner: https://github.com/ltsim
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@e0afc9d5cedc3365afa3012185e6218f32ccbada -
Trigger Event:
release
-
Statement type: