From dbc8ecb522667e4cc12aa9c95a38d10fa46e8a39 Mon Sep 17 00:00:00 2001 From: firefly-cpp Date: Sun, 25 Dec 2022 12:47:57 +0100 Subject: [PATCH 01/41] Update changelog --- CHANGELOG.md | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index af1306e..18d1380 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,17 @@ # Changelog +## [0.3.4](https://github.com/firefly-cpp/FireflyAlgorithm/tree/0.3.4) (2022-12-13) + +[Full Changelog](https://github.com/firefly-cpp/FireflyAlgorithm/compare/0.3.3...0.3.4) + +**Merged pull requests:** + +- logo add [\#10](https://github.com/firefly-cpp/FireflyAlgorithm/pull/10) ([rhododendrom](https://github.com/rhododendrom)) + +## [0.3.3](https://github.com/firefly-cpp/FireflyAlgorithm/tree/0.3.3) (2022-10-31) + +[Full Changelog](https://github.com/firefly-cpp/FireflyAlgorithm/compare/0.3.2...0.3.3) + ## [0.3.2](https://github.com/firefly-cpp/FireflyAlgorithm/tree/0.3.2) (2022-07-12) [Full Changelog](https://github.com/firefly-cpp/FireflyAlgorithm/compare/0.3.1...0.3.2) From 3585a59f969582bc82c22b994dfcada178df45a5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Carlos=20Aznar=C3=A1n=20Laos?= Date: Tue, 27 Dec 2022 16:20:42 -0500 Subject: [PATCH 02/41] Add instructions for install FireflyAlgorithm in Arch Linux --- README.md | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/README.md b/README.md index 48d016f..c325acc 100644 --- a/README.md +++ b/README.md @@ -12,6 +12,7 @@ ![PyPI - Python Version](https://img.shields.io/pypi/pyversions/fireflyalgorithm.svg) ![PyPI - Downloads](https://img.shields.io/pypi/dm/fireflyalgorithm.svg) [![Downloads](https://pepy.tech/badge/fireflyalgorithm)](https://pepy.tech/project/fireflyalgorithm) +[![AUR package](https://img.shields.io/aur/version/python-fireflyalgorithm?color=blue&label=Arch%20Linux&logo=arch-linux)](https://aur.archlinux.org/packages/python-fireflyalgorithm) [![GitHub license](https://img.shields.io/github/license/firefly-cpp/FireflyAlgorithm.svg)](https://github.com/firefly-cpp/FireflyAlgorithm/blob/master/LICENSE) ![GitHub commit activity](https://img.shields.io/github/commit-activity/w/firefly-cpp/FireflyAlgorithm.svg) [![Average time to resolve an issue](http://isitmaintained.com/badge/resolution/firefly-cpp/FireflyAlgorithm.svg)](http://isitmaintained.com/project/firefly-cpp/FireflyAlgorithm "Average time to resolve an issue") @@ -24,6 +25,7 @@ This package implements a nature-inspired algorithm for optimization called Fire ## Installation: +Install FireflyAlgorithm with pip: ```sh pip install fireflyalgorithm ``` @@ -31,6 +33,10 @@ To install FireflyAlgorithm on Fedora, use: ```sh dnf install python-fireflyalgorithm ``` +To install FireflyAlgorithm on Arch Linux, please use an [AUR helper](https://wiki.archlinux.org/title/AUR_helpers): +```sh +$ yay -Syyu python-fireflyalgorithm +``` ## Usage: From 761a927c205c11871841f59b9487b8299ad38b0b Mon Sep 17 00:00:00 2001 From: firefly-cpp Date: Mon, 23 Jan 2023 08:56:52 +0100 Subject: [PATCH 03/41] Improve workflows --- .github/workflows/python-app.yml | 36 ---------------------- .github/workflows/test.yml | 53 ++++++++++++++++++++++++++++++++ 2 files changed, 53 insertions(+), 36 deletions(-) delete mode 100644 .github/workflows/python-app.yml create mode 100644 .github/workflows/test.yml diff --git a/.github/workflows/python-app.yml b/.github/workflows/python-app.yml deleted file mode 100644 index ed1dee6..0000000 --- a/.github/workflows/python-app.yml +++ /dev/null @@ -1,36 +0,0 @@ -# This workflow will install Python dependencies, run tests and lint with a single version of Python -# For more information see: https://help.github.com/actions/language-and-framework-guides/using-python-with-github-actions - -name: FireflyAlgorithm - -on: - push: - branches: [ master ] - pull_request: - branches: [ master ] - -jobs: - build: - - runs-on: ubuntu-latest - - steps: - - uses: actions/checkout@v2 - - name: Set up Python 3.9 - uses: actions/setup-python@v2 - with: - python-version: "3.9" - - name: Install dependencies - run: | - python -m pip install --upgrade pip - pip install flake8 pytest numpy - if [ -f requirements.txt ]; then pip install -r requirements.txt; fi - - name: Lint with flake8 - run: | - # stop the build if there are Python syntax errors or undefined names - flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics - # exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide - flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics - - name: Test with pytest - run: | - pytest diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml new file mode 100644 index 0000000..f6fbc1a --- /dev/null +++ b/.github/workflows/test.yml @@ -0,0 +1,53 @@ +name: fireflyalgorithm + +on: + push: + branches: [ main ] + pull_request: + branches: [ main ] + +jobs: + build: + + runs-on: ${{ matrix.os }} + strategy: + matrix: + os: [ubuntu-latest, windows-latest, macos-latest] + python-version: ['3.9', '3.10'] + defaults: + run: + shell: bash + + steps: + - uses: actions/checkout@v3 + - name: Set up Python ${{ matrix.python-version }} + uses: actions/setup-python@v3 + with: + python-version: ${{ matrix.python-version }} + - name: Get full Python version + id: full-python-version + run: echo ::set-output name=version::$(python -c "import sys; print('-'.join(str(v) for v in sys.version_info))") + - name: Install poetry + run: | + curl -sL https://install.python-poetry.org | python - -y + - name: Update path + if: ${{ matrix.os != 'windows-latest' }} + run: echo "$HOME/.local/bin" >> $GITHUB_PATH + - name: Update Windows path + if: ${{ matrix.os == 'windows-latest' }} + run: echo "$APPDATA\Python\Scripts" >> $GITHUB_PATH + - name: Configure poetry + run: poetry config virtualenvs.in-project true + - name: Set up cache + uses: actions/cache@v3 + id: cache + with: + path: .venv + key: venv-${{ runner.os }}-${{ steps.full-python-version.outputs.version }}-${{ hashFiles('**/poetry.lock') }} + - name: Ensure cache is healthy + if: steps.cache.outputs.cache-hit == 'true' + run: timeout 10s poetry run pip --version || rm -rf .venv + - name: Install dependencies + run: poetry install + - name: Run tests + run: poetry run pytest From 63c86cf957295d2e2142d017ca44f34231588287 Mon Sep 17 00:00:00 2001 From: firefly-cpp Date: Mon, 23 Jan 2023 09:01:11 +0100 Subject: [PATCH 04/41] Fix workflow --- .github/workflows/test.yml | 4 ++-- requirements.txt | 1 - 2 files changed, 2 insertions(+), 3 deletions(-) delete mode 100644 requirements.txt diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index f6fbc1a..bebce77 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -2,9 +2,9 @@ name: fireflyalgorithm on: push: - branches: [ main ] + branches: [ master ] pull_request: - branches: [ main ] + branches: [ master ] jobs: build: diff --git a/requirements.txt b/requirements.txt deleted file mode 100644 index 24ce15a..0000000 --- a/requirements.txt +++ /dev/null @@ -1 +0,0 @@ -numpy From 6d70291476943e53c09fe1cbdb769f67d8a6d149 Mon Sep 17 00:00:00 2001 From: firefly-cpp Date: Mon, 23 Jan 2023 09:05:39 +0100 Subject: [PATCH 05/41] Update pyproject --- poetry.lock | 191 +++++++++++++++++-------------------------------- pyproject.toml | 2 +- 2 files changed, 67 insertions(+), 126 deletions(-) diff --git a/poetry.lock b/poetry.lock index 883a10b..79fe85b 100644 --- a/poetry.lock +++ b/poetry.lock @@ -1,16 +1,18 @@ [[package]] name = "attrs" -version = "22.1.0" +version = "22.2.0" description = "Classes Without Boilerplate" category = "dev" optional = false -python-versions = ">=3.5" +python-versions = ">=3.6" [package.extras] -tests_no_zope = ["cloudpickle", "pytest-mypy-plugins", "mypy (>=0.900,!=0.940)", "pytest (>=4.3.0)", "pympler", "hypothesis", "coverage[toml] (>=5.0.2)"] -tests = ["cloudpickle", "zope.interface", "pytest-mypy-plugins", "mypy (>=0.900,!=0.940)", "pytest (>=4.3.0)", "pympler", "hypothesis", "coverage[toml] (>=5.0.2)"] -docs = ["sphinx-notfound-page", "zope.interface", "sphinx", "furo"] -dev = ["cloudpickle", "pre-commit", "sphinx-notfound-page", "sphinx", "furo", "zope.interface", "pytest-mypy-plugins", "mypy (>=0.900,!=0.940)", "pytest (>=4.3.0)", "pympler", "hypothesis", "coverage[toml] (>=5.0.2)"] +cov = ["attrs", "coverage-enable-subprocess", "coverage[toml] (>=5.3)"] +dev = ["attrs"] +docs = ["furo", "sphinx", "myst-parser", "zope.interface", "sphinx-notfound-page", "sphinxcontrib-towncrier", "towncrier"] +tests = ["attrs", "zope.interface"] +tests-no-zope = ["hypothesis", "pympler", "pytest (>=4.3.0)", "pytest-xdist", "cloudpickle", "mypy (>=0.971,<0.990)", "pytest-mypy-plugins"] +tests_no_zope = ["hypothesis", "pympler", "pytest (>=4.3.0)", "pytest-xdist", "cloudpickle", "mypy (>=0.971,<0.990)", "pytest-mypy-plugins"] [[package]] name = "colorama" @@ -22,7 +24,7 @@ python-versions = "!=3.0.*,!=3.1.*,!=3.2.*,!=3.3.*,!=3.4.*,!=3.5.*,!=3.6.*,>=2.7 [[package]] name = "exceptiongroup" -version = "1.0.0" +version = "1.1.0" description = "Backport of PEP 654 (exception groups)" category = "dev" optional = false @@ -31,57 +33,29 @@ python-versions = ">=3.7" [package.extras] test = ["pytest (>=6)"] -[[package]] -name = "importlib-metadata" -version = "5.0.0" -description = "Read metadata from Python packages" -category = "dev" -optional = false -python-versions = ">=3.7" - -[package.dependencies] -typing-extensions = {version = ">=3.6.4", markers = "python_version < \"3.8\""} -zipp = ">=0.5" - -[package.extras] -docs = ["sphinx (>=3.5)", "jaraco.packaging (>=9)", "rst.linker (>=1.9)", "furo", "jaraco.tidelift (>=1.4)"] -perf = ["ipython"] -testing = ["pytest (>=6)", "pytest-checkdocs (>=2.4)", "pytest-flake8", "flake8 (<5)", "pytest-cov", "pytest-enabler (>=1.3)", "packaging", "pyfakefs", "flufl.flake8", "pytest-perf (>=0.9.2)", "pytest-black (>=0.3.7)", "pytest-mypy (>=0.9.1)", "importlib-resources (>=1.3)"] - [[package]] name = "iniconfig" -version = "1.1.1" -description = "iniconfig: brain-dead simple config-ini parsing" +version = "2.0.0" +description = "brain-dead simple config-ini parsing" category = "dev" optional = false -python-versions = "*" - -[[package]] -name = "numpy" -version = "1.21.6" -description = "NumPy is the fundamental package for array computing with Python." -category = "main" -optional = false -python-versions = ">=3.7,<3.11" +python-versions = ">=3.7" [[package]] name = "numpy" -version = "1.23.4" -description = "NumPy is the fundamental package for array computing with Python." +version = "1.24.1" +description = "Fundamental package for array computing in Python" category = "main" optional = false python-versions = ">=3.8" [[package]] name = "packaging" -version = "21.3" +version = "23.0" description = "Core utilities for Python packages" category = "dev" optional = false -python-versions = ">=3.6" - -[package.dependencies] -pyparsing = ">=2.0.2,<3.0.5 || >3.0.5" +python-versions = ">=3.7" [[package]] name = "pluggy" @@ -91,27 +65,13 @@ category = "dev" optional = false python-versions = ">=3.6" -[package.dependencies] -importlib-metadata = {version = ">=0.12", markers = "python_version < \"3.8\""} - [package.extras] dev = ["pre-commit", "tox"] testing = ["pytest", "pytest-benchmark"] -[[package]] -name = "pyparsing" -version = "3.0.9" -description = "pyparsing module - Classes and methods to define and execute parsing grammars" -category = "dev" -optional = false -python-versions = ">=3.6.8" - -[package.extras] -diagrams = ["railroad-diagrams", "jinja2"] - [[package]] name = "pytest" -version = "7.2.0" +version = "7.2.1" description = "pytest: simple powerful testing with Python" category = "dev" optional = false @@ -121,7 +81,6 @@ python-versions = ">=3.7" attrs = ">=19.2.0" colorama = {version = "*", markers = "sys_platform == \"win32\""} exceptiongroup = {version = ">=1.0.0rc8", markers = "python_version < \"3.11\""} -importlib-metadata = {version = ">=0.12", markers = "python_version < \"3.8\""} iniconfig = "*" packaging = "*" pluggy = ">=0.12,<2.0" @@ -138,89 +97,71 @@ category = "dev" optional = false python-versions = ">=3.7" -[[package]] -name = "typing-extensions" -version = "4.4.0" -description = "Backported and Experimental Type Hints for Python 3.7+" -category = "dev" -optional = false -python-versions = ">=3.7" - -[[package]] -name = "zipp" -version = "3.10.0" -description = "Backport of pathlib-compatible object wrapper for zip files" -category = "dev" -optional = false -python-versions = ">=3.7" - -[package.extras] -docs = ["sphinx (>=3.5)", "jaraco.packaging (>=9)", "rst.linker (>=1.9)", "furo", "jaraco.tidelift (>=1.4)"] -testing = ["pytest (>=6)", "pytest-checkdocs (>=2.4)", "pytest-flake8", "flake8 (<5)", "pytest-cov", "pytest-enabler (>=1.3)", "jaraco.itertools", "func-timeout", "jaraco.functools", "more-itertools", "pytest-black (>=0.3.7)", "pytest-mypy (>=0.9.1)"] - [metadata] lock-version = "1.1" -python-versions = "^3.7" -content-hash = "7886afe25f44148269aae9b5a98e0030046b4c5d7b8ad6a1c9dc6be8a57e1219" +python-versions = "^3.9" +content-hash = "ee07901be93db48ea18c563d48b12653e83a575fe902db609850e0f31719612c" [metadata.files] -attrs = [] -colorama = [] -exceptiongroup = [] -importlib-metadata = [] +attrs = [ + {file = "attrs-22.2.0-py3-none-any.whl", hash = "sha256:29e95c7f6778868dbd49170f98f8818f78f3dc5e0e37c0b1f474e3561b240836"}, + {file = "attrs-22.2.0.tar.gz", hash = "sha256:c9227bfc2f01993c03f68db37d1d15c9690188323c067c641f1a35ca58185f99"}, +] +colorama = [ + {file = "colorama-0.4.6-py2.py3-none-any.whl", hash = "sha256:4f1d9991f5acc0ca119f9d443620b77f9d6b33703e51011c16baf57afb285fc6"}, + {file = "colorama-0.4.6.tar.gz", hash = "sha256:08695f5cb7ed6e0531a20572697297273c47b8cae5a63ffc6d6ed5c201be6e44"}, +] +exceptiongroup = [ + {file = "exceptiongroup-1.1.0-py3-none-any.whl", hash = "sha256:327cbda3da756e2de031a3107b81ab7b3770a602c4d16ca618298c526f4bec1e"}, + {file = "exceptiongroup-1.1.0.tar.gz", hash = "sha256:bcb67d800a4497e1b404c2dd44fca47d3b7a5e5433dbab67f96c1a685cdfdf23"}, +] iniconfig = [ - {file = "iniconfig-1.1.1-py2.py3-none-any.whl", hash = "sha256:011e24c64b7f47f6ebd835bb12a743f2fbe9a26d4cecaa7f53bc4f35ee9da8b3"}, - {file = "iniconfig-1.1.1.tar.gz", hash = "sha256:bc3af051d7d14b2ee5ef9969666def0cd1a000e121eaea580d4a313df4b37f32"}, + {file = "iniconfig-2.0.0-py3-none-any.whl", hash = "sha256:b6a85871a79d2e3b22d2d1b94ac2824226a63c6b741c88f7ae975f18b6778374"}, + {file = "iniconfig-2.0.0.tar.gz", hash = "sha256:2d91e135bf72d31a410b17c16da610a82cb55f6b0477d1a902134b24a455b8b3"}, ] numpy = [ - {file = "numpy-1.21.6-cp310-cp310-macosx_10_9_universal2.whl", hash = "sha256:8737609c3bbdd48e380d463134a35ffad3b22dc56295eff6f79fd85bd0eeeb25"}, - {file = "numpy-1.21.6-cp310-cp310-macosx_10_9_x86_64.whl", hash = "sha256:fdffbfb6832cd0b300995a2b08b8f6fa9f6e856d562800fea9182316d99c4e8e"}, - {file = "numpy-1.21.6-cp310-cp310-macosx_11_0_arm64.whl", hash = "sha256:3820724272f9913b597ccd13a467cc492a0da6b05df26ea09e78b171a0bb9da6"}, - {file = "numpy-1.21.6-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:f17e562de9edf691a42ddb1eb4a5541c20dd3f9e65b09ded2beb0799c0cf29bb"}, - {file = "numpy-1.21.6-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:5f30427731561ce75d7048ac254dbe47a2ba576229250fb60f0fb74db96501a1"}, - {file = "numpy-1.21.6-cp310-cp310-win32.whl", hash = "sha256:d4bf4d43077db55589ffc9009c0ba0a94fa4908b9586d6ccce2e0b164c86303c"}, - {file = "numpy-1.21.6-cp310-cp310-win_amd64.whl", hash = "sha256:d136337ae3cc69aa5e447e78d8e1514be8c3ec9b54264e680cf0b4bd9011574f"}, - {file = "numpy-1.21.6-cp37-cp37m-macosx_10_9_x86_64.whl", hash = "sha256:6aaf96c7f8cebc220cdfc03f1d5a31952f027dda050e5a703a0d1c396075e3e7"}, - {file = "numpy-1.21.6-cp37-cp37m-manylinux_2_12_i686.manylinux2010_i686.whl", hash = "sha256:67c261d6c0a9981820c3a149d255a76918278a6b03b6a036800359aba1256d46"}, - {file = "numpy-1.21.6-cp37-cp37m-manylinux_2_12_x86_64.manylinux2010_x86_64.whl", hash = "sha256:a6be4cb0ef3b8c9250c19cc122267263093eee7edd4e3fa75395dfda8c17a8e2"}, - {file = "numpy-1.21.6-cp37-cp37m-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:7c4068a8c44014b2d55f3c3f574c376b2494ca9cc73d2f1bd692382b6dffe3db"}, - {file = "numpy-1.21.6-cp37-cp37m-win32.whl", hash = "sha256:7c7e5fa88d9ff656e067876e4736379cc962d185d5cd808014a8a928d529ef4e"}, - {file = "numpy-1.21.6-cp37-cp37m-win_amd64.whl", hash = "sha256:bcb238c9c96c00d3085b264e5c1a1207672577b93fa666c3b14a45240b14123a"}, - {file = "numpy-1.21.6-cp38-cp38-macosx_10_9_universal2.whl", hash = "sha256:82691fda7c3f77c90e62da69ae60b5ac08e87e775b09813559f8901a88266552"}, - {file = "numpy-1.21.6-cp38-cp38-macosx_10_9_x86_64.whl", hash = "sha256:643843bcc1c50526b3a71cd2ee561cf0d8773f062c8cbaf9ffac9fdf573f83ab"}, - {file = "numpy-1.21.6-cp38-cp38-macosx_11_0_arm64.whl", hash = "sha256:357768c2e4451ac241465157a3e929b265dfac85d9214074985b1786244f2ef3"}, - {file = "numpy-1.21.6-cp38-cp38-manylinux_2_12_i686.manylinux2010_i686.whl", hash = "sha256:9f411b2c3f3d76bba0865b35a425157c5dcf54937f82bbeb3d3c180789dd66a6"}, - {file = "numpy-1.21.6-cp38-cp38-manylinux_2_12_x86_64.manylinux2010_x86_64.whl", hash = "sha256:4aa48afdce4660b0076a00d80afa54e8a97cd49f457d68a4342d188a09451c1a"}, - {file = "numpy-1.21.6-cp38-cp38-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:d6a96eef20f639e6a97d23e57dd0c1b1069a7b4fd7027482a4c5c451cd7732f4"}, - {file = "numpy-1.21.6-cp38-cp38-win32.whl", hash = "sha256:5c3c8def4230e1b959671eb959083661b4a0d2e9af93ee339c7dada6759a9470"}, - {file = "numpy-1.21.6-cp38-cp38-win_amd64.whl", hash = "sha256:bf2ec4b75d0e9356edea834d1de42b31fe11f726a81dfb2c2112bc1eaa508fcf"}, - {file = "numpy-1.21.6-cp39-cp39-macosx_10_9_universal2.whl", hash = "sha256:4391bd07606be175aafd267ef9bea87cf1b8210c787666ce82073b05f202add1"}, - {file = "numpy-1.21.6-cp39-cp39-macosx_10_9_x86_64.whl", hash = "sha256:67f21981ba2f9d7ba9ade60c9e8cbaa8cf8e9ae51673934480e45cf55e953673"}, - {file = "numpy-1.21.6-cp39-cp39-macosx_11_0_arm64.whl", hash = "sha256:ee5ec40fdd06d62fe5d4084bef4fd50fd4bb6bfd2bf519365f569dc470163ab0"}, - {file = "numpy-1.21.6-cp39-cp39-manylinux_2_12_i686.manylinux2010_i686.whl", hash = "sha256:1dbe1c91269f880e364526649a52eff93ac30035507ae980d2fed33aaee633ac"}, - {file = "numpy-1.21.6-cp39-cp39-manylinux_2_12_x86_64.manylinux2010_x86_64.whl", hash = "sha256:d9caa9d5e682102453d96a0ee10c7241b72859b01a941a397fd965f23b3e016b"}, - {file = "numpy-1.21.6-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:58459d3bad03343ac4b1b42ed14d571b8743dc80ccbf27444f266729df1d6f5b"}, - {file = "numpy-1.21.6-cp39-cp39-win32.whl", hash = "sha256:7f5ae4f304257569ef3b948810816bc87c9146e8c446053539947eedeaa32786"}, - {file = "numpy-1.21.6-cp39-cp39-win_amd64.whl", hash = "sha256:e31f0bb5928b793169b87e3d1e070f2342b22d5245c755e2b81caa29756246c3"}, - {file = "numpy-1.21.6-pp37-pypy37_pp73-manylinux_2_12_x86_64.manylinux2010_x86_64.whl", hash = "sha256:dd1c8f6bd65d07d3810b90d02eba7997e32abbdf1277a481d698969e921a3be0"}, - {file = "numpy-1.21.6.zip", hash = "sha256:ecb55251139706669fdec2ff073c98ef8e9a84473e51e716211b41aa0f18e656"}, + {file = "numpy-1.24.1-cp310-cp310-macosx_10_9_x86_64.whl", hash = "sha256:179a7ef0889ab769cc03573b6217f54c8bd8e16cef80aad369e1e8185f994cd7"}, + {file = "numpy-1.24.1-cp310-cp310-macosx_11_0_arm64.whl", hash = "sha256:b09804ff570b907da323b3d762e74432fb07955701b17b08ff1b5ebaa8cfe6a9"}, + {file = "numpy-1.24.1-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:f1b739841821968798947d3afcefd386fa56da0caf97722a5de53e07c4ccedc7"}, + {file = "numpy-1.24.1-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:0e3463e6ac25313462e04aea3fb8a0a30fb906d5d300f58b3bc2c23da6a15398"}, + {file = "numpy-1.24.1-cp310-cp310-win32.whl", hash = "sha256:b31da69ed0c18be8b77bfce48d234e55d040793cebb25398e2a7d84199fbc7e2"}, + {file = "numpy-1.24.1-cp310-cp310-win_amd64.whl", hash = "sha256:b07b40f5fb4fa034120a5796288f24c1fe0e0580bbfff99897ba6267af42def2"}, + {file = "numpy-1.24.1-cp311-cp311-macosx_10_9_x86_64.whl", hash = "sha256:7094891dcf79ccc6bc2a1f30428fa5edb1e6fb955411ffff3401fb4ea93780a8"}, + {file = "numpy-1.24.1-cp311-cp311-macosx_11_0_arm64.whl", hash = "sha256:28e418681372520c992805bb723e29d69d6b7aa411065f48216d8329d02ba032"}, + {file = "numpy-1.24.1-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:e274f0f6c7efd0d577744f52032fdd24344f11c5ae668fe8d01aac0422611df1"}, + {file = "numpy-1.24.1-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:0044f7d944ee882400890f9ae955220d29b33d809a038923d88e4e01d652acd9"}, + {file = "numpy-1.24.1-cp311-cp311-win32.whl", hash = "sha256:442feb5e5bada8408e8fcd43f3360b78683ff12a4444670a7d9e9824c1817d36"}, + {file = "numpy-1.24.1-cp311-cp311-win_amd64.whl", hash = "sha256:de92efa737875329b052982e37bd4371d52cabf469f83e7b8be9bb7752d67e51"}, + {file = "numpy-1.24.1-cp38-cp38-macosx_10_9_x86_64.whl", hash = "sha256:b162ac10ca38850510caf8ea33f89edcb7b0bb0dfa5592d59909419986b72407"}, + {file = "numpy-1.24.1-cp38-cp38-macosx_11_0_arm64.whl", hash = "sha256:26089487086f2648944f17adaa1a97ca6aee57f513ba5f1c0b7ebdabbe2b9954"}, + {file = "numpy-1.24.1-cp38-cp38-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:caf65a396c0d1f9809596be2e444e3bd4190d86d5c1ce21f5fc4be60a3bc5b36"}, + {file = "numpy-1.24.1-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:b0677a52f5d896e84414761531947c7a330d1adc07c3a4372262f25d84af7bf7"}, + {file = "numpy-1.24.1-cp38-cp38-win32.whl", hash = "sha256:dae46bed2cb79a58d6496ff6d8da1e3b95ba09afeca2e277628171ca99b99db1"}, + {file = "numpy-1.24.1-cp38-cp38-win_amd64.whl", hash = "sha256:6ec0c021cd9fe732e5bab6401adea5a409214ca5592cd92a114f7067febcba0c"}, + {file = "numpy-1.24.1-cp39-cp39-macosx_10_9_x86_64.whl", hash = "sha256:28bc9750ae1f75264ee0f10561709b1462d450a4808cd97c013046073ae64ab6"}, + {file = "numpy-1.24.1-cp39-cp39-macosx_11_0_arm64.whl", hash = "sha256:84e789a085aabef2f36c0515f45e459f02f570c4b4c4c108ac1179c34d475ed7"}, + {file = "numpy-1.24.1-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:8e669fbdcdd1e945691079c2cae335f3e3a56554e06bbd45d7609a6cf568c700"}, + {file = "numpy-1.24.1-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:ef85cf1f693c88c1fd229ccd1055570cb41cdf4875873b7728b6301f12cd05bf"}, + {file = "numpy-1.24.1-cp39-cp39-win32.whl", hash = "sha256:87a118968fba001b248aac90e502c0b13606721b1343cdaddbc6e552e8dfb56f"}, + {file = "numpy-1.24.1-cp39-cp39-win_amd64.whl", hash = "sha256:ddc7ab52b322eb1e40521eb422c4e0a20716c271a306860979d450decbb51b8e"}, + {file = "numpy-1.24.1-pp38-pypy38_pp73-macosx_10_9_x86_64.whl", hash = "sha256:ed5fb71d79e771ec930566fae9c02626b939e37271ec285e9efaf1b5d4370e7d"}, + {file = "numpy-1.24.1-pp38-pypy38_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:ad2925567f43643f51255220424c23d204024ed428afc5aad0f86f3ffc080086"}, + {file = "numpy-1.24.1-pp38-pypy38_pp73-win_amd64.whl", hash = "sha256:cfa1161c6ac8f92dea03d625c2d0c05e084668f4a06568b77a25a89111621566"}, + {file = "numpy-1.24.1.tar.gz", hash = "sha256:2386da9a471cc00a1f47845e27d916d5ec5346ae9696e01a8a34760858fe9dd2"}, ] packaging = [ - {file = "packaging-21.3-py3-none-any.whl", hash = "sha256:ef103e05f519cdc783ae24ea4e2e0f508a9c99b2d4969652eed6a2e1ea5bd522"}, - {file = "packaging-21.3.tar.gz", hash = "sha256:dd47c42927d89ab911e606518907cc2d3a1f38bbd026385970643f9c5b8ecfeb"}, + {file = "packaging-23.0-py3-none-any.whl", hash = "sha256:714ac14496c3e68c99c29b00845f7a2b85f3bb6f1078fd9f72fd20f0570002b2"}, + {file = "packaging-23.0.tar.gz", hash = "sha256:b6ad297f8907de0fa2fe1ccbd26fdaf387f5f47c7275fedf8cce89f99446cf97"}, ] pluggy = [ {file = "pluggy-1.0.0-py2.py3-none-any.whl", hash = "sha256:74134bbf457f031a36d68416e1509f34bd5ccc019f0bcc952c7b909d06b37bd3"}, {file = "pluggy-1.0.0.tar.gz", hash = "sha256:4224373bacce55f955a878bf9cfa763c1e360858e330072059e10bad68531159"}, ] -pyparsing = [ - {file = "pyparsing-3.0.9-py3-none-any.whl", hash = "sha256:5026bae9a10eeaefb61dab2f09052b9f4307d44aee4eda64b309723d8d206bbc"}, - {file = "pyparsing-3.0.9.tar.gz", hash = "sha256:2b020ecf7d21b687f219b71ecad3631f644a47f01403fa1d1036b0c6416d70fb"}, +pytest = [ + {file = "pytest-7.2.1-py3-none-any.whl", hash = "sha256:c7c6ca206e93355074ae32f7403e8ea12163b1163c976fee7d4d84027c162be5"}, + {file = "pytest-7.2.1.tar.gz", hash = "sha256:d45e0952f3727241918b8fd0f376f5ff6b301cc0777c6f9a556935c92d8a7d42"}, ] -pytest = [] tomli = [ {file = "tomli-2.0.1-py3-none-any.whl", hash = "sha256:939de3e7a6161af0c887ef91b7d41a53e7c5a1ca976325f429cb46ea9bc30ecc"}, {file = "tomli-2.0.1.tar.gz", hash = "sha256:de526c12914f0c550d15924c62d72abc48d6fe7364aa87328337a31007fe8a4f"}, ] -typing-extensions = [] -zipp = [] diff --git a/pyproject.toml b/pyproject.toml index cbf1ab2..6ebe666 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -13,7 +13,7 @@ include = [ ] [tool.poetry.dependencies] -python = "^3.7" +python = "^3.9" numpy = [ { version = "^1.21.5", python = ">=3.7,<3.11" }, { version = "^1.22.0", python = "^3.11" } From fe6137c0065bc7066cf83bbe041256d1e5d6cba5 Mon Sep 17 00:00:00 2001 From: Iztok Fister Jr Date: Wed, 13 Sep 2023 14:25:39 +0200 Subject: [PATCH 06/41] Update LICENSE --- LICENSE | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/LICENSE b/LICENSE index 0500760..0d39b71 100644 --- a/LICENSE +++ b/LICENSE @@ -1,6 +1,6 @@ MIT License -Copyright (c) 2017 firefly-cpp +Copyright (c) 2017-2023 firefly-cpp Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal From aafbdb3283da2c84bfaa40bfb3845db5fff15b4b Mon Sep 17 00:00:00 2001 From: zStupan Date: Sun, 5 Nov 2023 20:14:09 +0100 Subject: [PATCH 07/41] added test problem implementations --- fireflyalgorithm/problems.py | 268 +++++++++++++++++++++++++++++++++++ 1 file changed, 268 insertions(+) create mode 100644 fireflyalgorithm/problems.py diff --git a/fireflyalgorithm/problems.py b/fireflyalgorithm/problems.py new file mode 100644 index 0000000..e0747e6 --- /dev/null +++ b/fireflyalgorithm/problems.py @@ -0,0 +1,268 @@ +import numpy as np + + +def ackley(x): + a = 20 + b = 0.2 + c = 2 * np.pi + dim = len(x) + + val1 = np.sum(np.square(x)) + val2 = np.sum(np.cos(c * x)) + + temp1 = -b * np.sqrt(val1 / dim) + temp2 = val2 / dim + + return -a * np.exp(temp1) - np.exp(temp2) + a + np.exp(1) + + +def alpine1(x): + return np.sum(np.abs(np.sin(x) + 0.1 * x)) + + +def alpine2(x): + return np.prod(np.sqrt(x) * np.sin(x)) + + +def cigar(x): + return x[0] ** 2 + 1000000 * np.sum(x[1:] ** 2) + + +def cosine_mixture(x): + return -0.1 * np.sum(np.cos(5 * np.pi * x)) - np.sum(x**2) + + +def csendes(x): + mask = x != 0 + return np.sum(np.power(x[mask], 6) * (2 + np.sin(1 / x[mask]))) + + +def dixon_price(x): + dim = len(x) + indices = np.arange(2, dim) + val = np.sum(indices * (2 * x[2:] ** 2 - x[1 : dim - 1]) ** 2) + return (x[0] - 1) ** 2 + val + + +def griewank(x): + dim = len(x) + i = np.arange(1, dim + 1) + val1 = np.sum(x**2 / 4000) + val2 = np.prod(np.cos(x / np.sqrt(i))) + return val1 - val2 + 1 + + +def katsuura(x): + dim = len(x) + k = np.atleast_2d(np.arange(1, 33)).T + i = np.arange(0, dim * 1) + inner = np.round(2**k * x) * (2 ** (-k)) + return np.prod(np.sum(inner, axis=0) * (i + 1) + 1) + + +def levy(x): + w = 1 + (x - 1) / 4 + wi = w[:-1] + term1 = np.sin(np.pi * w[0]) ** 2 + term2 = np.sum((wi - 1) ** 2 * (1 + 10 * np.sin(np.pi * wi + 1))) + term3 = (w[-1] - 1) ** 2 * (1 + np.sin(2 * np.pi * w[-1]) ** 2) + return term1 + term2 + term3 + + +def michalewicz(x): + dim = len(x) + m = 10 + i = np.arange(1, dim + 1) + return -np.sum(np.sin(x) * np.sin(i * x**2 / np.pi) ** (2 * m)) + + +def perm1(x): + dim = len(x) + beta = 0.5 + k = np.atleast_2d(np.arange(dim) + 1).T + j = np.atleast_2d(np.arange(dim) + 1) + s = (j**k + beta) * ((x / j) ** k - 1) + return np.sum(np.sum(s, axis=1) ** 2) + + +def perm2(x): + dim = len(x) + beta = 10 + k = np.atleast_2d(np.arange(dim) + 1).T + j = np.atleast_2d(np.arange(dim) + 1) + s = (j + beta) * (x**k - (1 / j) ** k) + return np.sum(np.sum(s, axis=1) ** 2) + + +def pinter(x): + dim = len(x) + x = np.asarray(x) + sub = np.roll(x, 1) + add = np.roll(x, -1) + indices = np.arange(1, dim + 1) + + a = sub * np.sin(x) + np.sin(add) + b = (sub * sub) - 2 * x + 3 * add - np.cos(x) + 1 + + val1 = np.sum(indices * x * x) + val2 = np.sum(20 * indices * np.power(np.sin(a), 2)) + val3 = np.sum(indices * np.log10(1 + indices * np.power(b, 2))) + + return val1 + val2 + val3 + + +def powell(x): + x1 = x[0::4] + x2 = x[1::4] + x3 = x[2::4] + x4 = x[3::4] + + term1 = (x1 + 10 * x2) ** 2 + term2 = 5 * (x3 - x4) ** 2 + term3 = (x2 - 2 * x3) ** 4 + term4 = 10 * (x1 - x4) ** 4 + return np.sum(term1 + term2 + term3 + term4) + + +def quing(x): + dim = len(x) + return np.sum(np.power(x**2 - np.arange(1, dim + 1), 2)) + + +def quintic(x): + return np.sum(np.abs(x**5 - 3 * x**4 + 4 * x**3 + 2 * x**2 - 10 * x - 4)) + + +def rastrigin(x): + dim = len(x) + return 10 * dim + np.sum(x**2 - 10 * np.cos(2 * np.pi * x)) + + +def rosenbrock(x): + return np.sum(100.0 * (x[1:] - x[:-1] ** 2) ** 2 + (1 - x[:-1]) ** 2, axis=0) + + +def salomon(x): + val = np.sqrt(np.sum(x**2)) + return 1 - np.cos(2 * np.pi * val) + 0.1 * val + + +def schaffer2(x): + return ( + 0.5 + + (np.sin(x[0] ** 2 - x[1] ** 2) ** 2 - 0.5) + / (1 + 0.001 * (x[0] ** 2 + x[1] ** 2)) ** 2 + ) + + +def schaffer4(x): + return ( + 0.5 + + (np.cos(np.sin(x[0] ** 2 - x[1] ** 2)) ** 2 - 0.5) + / (1 + 0.001 * (x[0] ** 2 + x[1] ** 2)) ** 2 + ) + + +def schwefel(x): + dim = len(x) + return 418.9829 * dim - np.sum(x * np.sin(np.sqrt(np.abs(x)))) + + +def schwefel21(x): + return np.amax(np.abs(x)) + + +def schwefel22(x): + return np.sum(np.abs(x)) + np.prod(np.abs(x)) + + +def sphere(x): + return np.sum(x**2) + + +def step(x): + return np.sum(np.floor(np.abs(x))) + + +def step2(x): + return np.sum(np.floor(x + 0.5) ** 2) + + +def styblinski_tang(x): + return 0.5 * np.sum(x**4 - 16 * x**2 + 5 * x) + + +def trid(x): + sum1 = np.sum((x - 1) ** 2) + sum2 = np.sum(x[1:] * x[:-1]) + return sum1 - sum2 + + +def weierstrass(x): + dim = len(x) + kmax = 20 + a = 0.5 + b = 3 + + k = np.atleast_2d(np.arange(kmax + 1)).T + t1 = a**k * np.cos(2 * np.pi * b**k * (x + 0.5)) + t2 = dim * np.sum(a**k.T * np.cos(np.pi * b**k.T)) + + return np.sum(np.sum(t1, axis=0)) - t2 + + +def whitley(x): + xi = x + xj = np.atleast_2d(x).T + + temp = 100 * ((xi**2) - xj) + (1 - xj) ** 2 + inner = (temp**2 / 4000) - np.cos(temp) + 1 + return np.sum(np.sum(inner, axis=0)) + + +def zakharov(x): + dim = len(x) + sum1 = np.sum(x**2) + sum2 = 0.5 * np.sum(np.arange(1, dim + 1) * x) + return sum1 + sum2**2 + sum2**4 + + +PROBLEMS = { + "ackley": ackley, + "alpine1": alpine1, + "alpine2": alpine2, + "cigar": cigar, + "cosine_mixture": cosine_mixture, + "csendes": csendes, + "dixon_price": dixon_price, + "griewank": griewank, + "katsuura": katsuura, + "levy": levy, + "michalewicz": michalewicz, + "perm1": perm1, + "perm2": perm2, + "pinter": pinter, + "powell": powell, + "quing": quing, + "quintic": quintic, + "rastrigin": rastrigin, + "rosenbrock": rosenbrock, + "salomon": salomon, + "schaffer2": schaffer2, + "schaffer4": schaffer4, + "schwefel": schwefel, + "schwefel21": schwefel21, + "schwefel22": schwefel22, + "sphere": sphere, + "step": step, + "step2": step2, + "styblinski_tang": styblinski_tang, + "trid": trid, + "weierstrass": weierstrass, + "whitley": whitley, + "zakharov": zakharov, +} + + +def get_problem(name): + return PROBLEMS[name] From ba4dfe4617626a29d84f519d992ea4b0ccdf01a6 Mon Sep 17 00:00:00 2001 From: zStupan Date: Sun, 5 Nov 2023 20:15:19 +0100 Subject: [PATCH 08/41] updated dependencies --- poetry.lock | 171 +++++++++++++++++++++---------------------------- pyproject.toml | 11 ++-- 2 files changed, 77 insertions(+), 105 deletions(-) diff --git a/poetry.lock b/poetry.lock index 79fe85b..0bf4182 100644 --- a/poetry.lock +++ b/poetry.lock @@ -1,34 +1,26 @@ -[[package]] -name = "attrs" -version = "22.2.0" -description = "Classes Without Boilerplate" -category = "dev" -optional = false -python-versions = ">=3.6" - -[package.extras] -cov = ["attrs", "coverage-enable-subprocess", "coverage[toml] (>=5.3)"] -dev = ["attrs"] -docs = ["furo", "sphinx", "myst-parser", "zope.interface", "sphinx-notfound-page", "sphinxcontrib-towncrier", "towncrier"] -tests = ["attrs", "zope.interface"] -tests-no-zope = ["hypothesis", "pympler", "pytest (>=4.3.0)", "pytest-xdist", "cloudpickle", "mypy (>=0.971,<0.990)", "pytest-mypy-plugins"] -tests_no_zope = ["hypothesis", "pympler", "pytest (>=4.3.0)", "pytest-xdist", "cloudpickle", "mypy (>=0.971,<0.990)", "pytest-mypy-plugins"] +# This file is automatically @generated by Poetry 1.7.0 and should not be changed by hand. [[package]] name = "colorama" version = "0.4.6" description = "Cross-platform colored terminal text." -category = "dev" optional = false python-versions = "!=3.0.*,!=3.1.*,!=3.2.*,!=3.3.*,!=3.4.*,!=3.5.*,!=3.6.*,>=2.7" +files = [ + {file = "colorama-0.4.6-py2.py3-none-any.whl", hash = "sha256:4f1d9991f5acc0ca119f9d443620b77f9d6b33703e51011c16baf57afb285fc6"}, + {file = "colorama-0.4.6.tar.gz", hash = "sha256:08695f5cb7ed6e0531a20572697297273c47b8cae5a63ffc6d6ed5c201be6e44"}, +] [[package]] name = "exceptiongroup" -version = "1.1.0" +version = "1.1.3" description = "Backport of PEP 654 (exception groups)" -category = "dev" optional = false python-versions = ">=3.7" +files = [ + {file = "exceptiongroup-1.1.3-py3-none-any.whl", hash = "sha256:343280667a4585d195ca1cf9cef84a4e178c4b6cf2274caef9859782b567d5e3"}, + {file = "exceptiongroup-1.1.3.tar.gz", hash = "sha256:097acd85d473d75af5bb98e41b61ff7fe35efe6675e4f9370ec6ec5126d160e9"}, +] [package.extras] test = ["pytest (>=6)"] @@ -37,33 +29,75 @@ test = ["pytest (>=6)"] name = "iniconfig" version = "2.0.0" description = "brain-dead simple config-ini parsing" -category = "dev" optional = false python-versions = ">=3.7" +files = [ + {file = "iniconfig-2.0.0-py3-none-any.whl", hash = "sha256:b6a85871a79d2e3b22d2d1b94ac2824226a63c6b741c88f7ae975f18b6778374"}, + {file = "iniconfig-2.0.0.tar.gz", hash = "sha256:2d91e135bf72d31a410b17c16da610a82cb55f6b0477d1a902134b24a455b8b3"}, +] [[package]] name = "numpy" -version = "1.24.1" +version = "1.26.1" description = "Fundamental package for array computing in Python" -category = "main" optional = false -python-versions = ">=3.8" +python-versions = "<3.13,>=3.9" +files = [ + {file = "numpy-1.26.1-cp310-cp310-macosx_10_9_x86_64.whl", hash = "sha256:82e871307a6331b5f09efda3c22e03c095d957f04bf6bc1804f30048d0e5e7af"}, + {file = "numpy-1.26.1-cp310-cp310-macosx_11_0_arm64.whl", hash = "sha256:cdd9ec98f0063d93baeb01aad472a1a0840dee302842a2746a7a8e92968f9575"}, + {file = "numpy-1.26.1-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:d78f269e0c4fd365fc2992c00353e4530d274ba68f15e968d8bc3c69ce5f5244"}, + {file = "numpy-1.26.1-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:8ab9163ca8aeb7fd32fe93866490654d2f7dda4e61bc6297bf72ce07fdc02f67"}, + {file = "numpy-1.26.1-cp310-cp310-musllinux_1_1_x86_64.whl", hash = "sha256:78ca54b2f9daffa5f323f34cdf21e1d9779a54073f0018a3094ab907938331a2"}, + {file = "numpy-1.26.1-cp310-cp310-win32.whl", hash = "sha256:d1cfc92db6af1fd37a7bb58e55c8383b4aa1ba23d012bdbba26b4bcca45ac297"}, + {file = "numpy-1.26.1-cp310-cp310-win_amd64.whl", hash = "sha256:d2984cb6caaf05294b8466966627e80bf6c7afd273279077679cb010acb0e5ab"}, + {file = "numpy-1.26.1-cp311-cp311-macosx_10_9_x86_64.whl", hash = "sha256:cd7837b2b734ca72959a1caf3309457a318c934abef7a43a14bb984e574bbb9a"}, + {file = "numpy-1.26.1-cp311-cp311-macosx_11_0_arm64.whl", hash = "sha256:1c59c046c31a43310ad0199d6299e59f57a289e22f0f36951ced1c9eac3665b9"}, + {file = "numpy-1.26.1-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:d58e8c51a7cf43090d124d5073bc29ab2755822181fcad978b12e144e5e5a4b3"}, + {file = "numpy-1.26.1-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:6081aed64714a18c72b168a9276095ef9155dd7888b9e74b5987808f0dd0a974"}, + {file = "numpy-1.26.1-cp311-cp311-musllinux_1_1_x86_64.whl", hash = "sha256:97e5d6a9f0702c2863aaabf19f0d1b6c2628fbe476438ce0b5ce06e83085064c"}, + {file = "numpy-1.26.1-cp311-cp311-win32.whl", hash = "sha256:b9d45d1dbb9de84894cc50efece5b09939752a2d75aab3a8b0cef6f3a35ecd6b"}, + {file = "numpy-1.26.1-cp311-cp311-win_amd64.whl", hash = "sha256:3649d566e2fc067597125428db15d60eb42a4e0897fc48d28cb75dc2e0454e53"}, + {file = "numpy-1.26.1-cp312-cp312-macosx_10_9_x86_64.whl", hash = "sha256:1d1bd82d539607951cac963388534da3b7ea0e18b149a53cf883d8f699178c0f"}, + {file = "numpy-1.26.1-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:afd5ced4e5a96dac6725daeb5242a35494243f2239244fad10a90ce58b071d24"}, + {file = "numpy-1.26.1-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:a03fb25610ef560a6201ff06df4f8105292ba56e7cdd196ea350d123fc32e24e"}, + {file = "numpy-1.26.1-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:dcfaf015b79d1f9f9c9fd0731a907407dc3e45769262d657d754c3a028586124"}, + {file = "numpy-1.26.1-cp312-cp312-musllinux_1_1_x86_64.whl", hash = "sha256:e509cbc488c735b43b5ffea175235cec24bbc57b227ef1acc691725beb230d1c"}, + {file = "numpy-1.26.1-cp312-cp312-win32.whl", hash = "sha256:af22f3d8e228d84d1c0c44c1fbdeb80f97a15a0abe4f080960393a00db733b66"}, + {file = "numpy-1.26.1-cp312-cp312-win_amd64.whl", hash = "sha256:9f42284ebf91bdf32fafac29d29d4c07e5e9d1af862ea73686581773ef9e73a7"}, + {file = "numpy-1.26.1-cp39-cp39-macosx_10_9_x86_64.whl", hash = "sha256:bb894accfd16b867d8643fc2ba6c8617c78ba2828051e9a69511644ce86ce83e"}, + {file = "numpy-1.26.1-cp39-cp39-macosx_11_0_arm64.whl", hash = "sha256:e44ccb93f30c75dfc0c3aa3ce38f33486a75ec9abadabd4e59f114994a9c4617"}, + {file = "numpy-1.26.1-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:9696aa2e35cc41e398a6d42d147cf326f8f9d81befcb399bc1ed7ffea339b64e"}, + {file = "numpy-1.26.1-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:a5b411040beead47a228bde3b2241100454a6abde9df139ed087bd73fc0a4908"}, + {file = "numpy-1.26.1-cp39-cp39-musllinux_1_1_x86_64.whl", hash = "sha256:1e11668d6f756ca5ef534b5be8653d16c5352cbb210a5c2a79ff288e937010d5"}, + {file = "numpy-1.26.1-cp39-cp39-win32.whl", hash = "sha256:d1d2c6b7dd618c41e202c59c1413ef9b2c8e8a15f5039e344af64195459e3104"}, + {file = "numpy-1.26.1-cp39-cp39-win_amd64.whl", hash = "sha256:59227c981d43425ca5e5c01094d59eb14e8772ce6975d4b2fc1e106a833d5ae2"}, + {file = "numpy-1.26.1-pp39-pypy39_pp73-macosx_10_9_x86_64.whl", hash = "sha256:06934e1a22c54636a059215d6da99e23286424f316fddd979f5071093b648668"}, + {file = "numpy-1.26.1-pp39-pypy39_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:76ff661a867d9272cd2a99eed002470f46dbe0943a5ffd140f49be84f68ffc42"}, + {file = "numpy-1.26.1-pp39-pypy39_pp73-win_amd64.whl", hash = "sha256:6965888d65d2848e8768824ca8288db0a81263c1efccec881cb35a0d805fcd2f"}, + {file = "numpy-1.26.1.tar.gz", hash = "sha256:c8c6c72d4a9f831f328efb1312642a1cafafaa88981d9ab76368d50d07d93cbe"}, +] [[package]] name = "packaging" -version = "23.0" +version = "23.2" description = "Core utilities for Python packages" -category = "dev" optional = false python-versions = ">=3.7" +files = [ + {file = "packaging-23.2-py3-none-any.whl", hash = "sha256:8c491190033a9af7e1d931d0b5dacc2ef47509b34dd0de67ed209b5203fc88c7"}, + {file = "packaging-23.2.tar.gz", hash = "sha256:048fb0e9405036518eaaf48a55953c750c11e1a1b68e0dd1a9d62ed0c092cfc5"}, +] [[package]] name = "pluggy" -version = "1.0.0" +version = "1.3.0" description = "plugin and hook calling mechanisms for python" -category = "dev" optional = false -python-versions = ">=3.6" +python-versions = ">=3.8" +files = [ + {file = "pluggy-1.3.0-py3-none-any.whl", hash = "sha256:d89c696a773f8bd377d18e5ecda92b7a3793cbe66c87060a6fb58c7b6e1061f7"}, + {file = "pluggy-1.3.0.tar.gz", hash = "sha256:cf61ae8f126ac6f7c451172cf30e3e43d3ca77615509771b3a984a0730651e12"}, +] [package.extras] dev = ["pre-commit", "tox"] @@ -71,14 +105,16 @@ testing = ["pytest", "pytest-benchmark"] [[package]] name = "pytest" -version = "7.2.1" +version = "7.4.3" description = "pytest: simple powerful testing with Python" -category = "dev" optional = false python-versions = ">=3.7" +files = [ + {file = "pytest-7.4.3-py3-none-any.whl", hash = "sha256:0d009c083ea859a71b76adf7c1d502e4bc170b80a8ef002da5806527b9591fac"}, + {file = "pytest-7.4.3.tar.gz", hash = "sha256:d989d136982de4e3b29dabcc838ad581c64e8ed52c11fbe86ddebd9da0818cd5"}, +] [package.dependencies] -attrs = ">=19.2.0" colorama = {version = "*", markers = "sys_platform == \"win32\""} exceptiongroup = {version = ">=1.0.0rc8", markers = "python_version < \"3.11\""} iniconfig = "*" @@ -87,81 +123,20 @@ pluggy = ">=0.12,<2.0" tomli = {version = ">=1.0.0", markers = "python_version < \"3.11\""} [package.extras] -testing = ["argcomplete", "hypothesis (>=3.56)", "mock", "nose", "pygments (>=2.7.2)", "requests", "xmlschema"] +testing = ["argcomplete", "attrs (>=19.2.0)", "hypothesis (>=3.56)", "mock", "nose", "pygments (>=2.7.2)", "requests", "setuptools", "xmlschema"] [[package]] name = "tomli" version = "2.0.1" description = "A lil' TOML parser" -category = "dev" optional = false python-versions = ">=3.7" - -[metadata] -lock-version = "1.1" -python-versions = "^3.9" -content-hash = "ee07901be93db48ea18c563d48b12653e83a575fe902db609850e0f31719612c" - -[metadata.files] -attrs = [ - {file = "attrs-22.2.0-py3-none-any.whl", hash = "sha256:29e95c7f6778868dbd49170f98f8818f78f3dc5e0e37c0b1f474e3561b240836"}, - {file = "attrs-22.2.0.tar.gz", hash = "sha256:c9227bfc2f01993c03f68db37d1d15c9690188323c067c641f1a35ca58185f99"}, -] -colorama = [ - {file = "colorama-0.4.6-py2.py3-none-any.whl", hash = "sha256:4f1d9991f5acc0ca119f9d443620b77f9d6b33703e51011c16baf57afb285fc6"}, - {file = "colorama-0.4.6.tar.gz", hash = "sha256:08695f5cb7ed6e0531a20572697297273c47b8cae5a63ffc6d6ed5c201be6e44"}, -] -exceptiongroup = [ - {file = "exceptiongroup-1.1.0-py3-none-any.whl", hash = "sha256:327cbda3da756e2de031a3107b81ab7b3770a602c4d16ca618298c526f4bec1e"}, - {file = "exceptiongroup-1.1.0.tar.gz", hash = "sha256:bcb67d800a4497e1b404c2dd44fca47d3b7a5e5433dbab67f96c1a685cdfdf23"}, -] -iniconfig = [ - {file = "iniconfig-2.0.0-py3-none-any.whl", hash = "sha256:b6a85871a79d2e3b22d2d1b94ac2824226a63c6b741c88f7ae975f18b6778374"}, - {file = "iniconfig-2.0.0.tar.gz", hash = "sha256:2d91e135bf72d31a410b17c16da610a82cb55f6b0477d1a902134b24a455b8b3"}, -] -numpy = [ - {file = "numpy-1.24.1-cp310-cp310-macosx_10_9_x86_64.whl", hash = "sha256:179a7ef0889ab769cc03573b6217f54c8bd8e16cef80aad369e1e8185f994cd7"}, - {file = "numpy-1.24.1-cp310-cp310-macosx_11_0_arm64.whl", hash = "sha256:b09804ff570b907da323b3d762e74432fb07955701b17b08ff1b5ebaa8cfe6a9"}, - {file = "numpy-1.24.1-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:f1b739841821968798947d3afcefd386fa56da0caf97722a5de53e07c4ccedc7"}, - {file = "numpy-1.24.1-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:0e3463e6ac25313462e04aea3fb8a0a30fb906d5d300f58b3bc2c23da6a15398"}, - {file = "numpy-1.24.1-cp310-cp310-win32.whl", hash = "sha256:b31da69ed0c18be8b77bfce48d234e55d040793cebb25398e2a7d84199fbc7e2"}, - {file = "numpy-1.24.1-cp310-cp310-win_amd64.whl", hash = "sha256:b07b40f5fb4fa034120a5796288f24c1fe0e0580bbfff99897ba6267af42def2"}, - {file = "numpy-1.24.1-cp311-cp311-macosx_10_9_x86_64.whl", hash = "sha256:7094891dcf79ccc6bc2a1f30428fa5edb1e6fb955411ffff3401fb4ea93780a8"}, - {file = "numpy-1.24.1-cp311-cp311-macosx_11_0_arm64.whl", hash = "sha256:28e418681372520c992805bb723e29d69d6b7aa411065f48216d8329d02ba032"}, - {file = "numpy-1.24.1-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:e274f0f6c7efd0d577744f52032fdd24344f11c5ae668fe8d01aac0422611df1"}, - {file = "numpy-1.24.1-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:0044f7d944ee882400890f9ae955220d29b33d809a038923d88e4e01d652acd9"}, - {file = "numpy-1.24.1-cp311-cp311-win32.whl", hash = "sha256:442feb5e5bada8408e8fcd43f3360b78683ff12a4444670a7d9e9824c1817d36"}, - {file = "numpy-1.24.1-cp311-cp311-win_amd64.whl", hash = "sha256:de92efa737875329b052982e37bd4371d52cabf469f83e7b8be9bb7752d67e51"}, - {file = "numpy-1.24.1-cp38-cp38-macosx_10_9_x86_64.whl", hash = "sha256:b162ac10ca38850510caf8ea33f89edcb7b0bb0dfa5592d59909419986b72407"}, - {file = "numpy-1.24.1-cp38-cp38-macosx_11_0_arm64.whl", hash = "sha256:26089487086f2648944f17adaa1a97ca6aee57f513ba5f1c0b7ebdabbe2b9954"}, - {file = "numpy-1.24.1-cp38-cp38-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:caf65a396c0d1f9809596be2e444e3bd4190d86d5c1ce21f5fc4be60a3bc5b36"}, - {file = "numpy-1.24.1-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:b0677a52f5d896e84414761531947c7a330d1adc07c3a4372262f25d84af7bf7"}, - {file = "numpy-1.24.1-cp38-cp38-win32.whl", hash = "sha256:dae46bed2cb79a58d6496ff6d8da1e3b95ba09afeca2e277628171ca99b99db1"}, - {file = "numpy-1.24.1-cp38-cp38-win_amd64.whl", hash = "sha256:6ec0c021cd9fe732e5bab6401adea5a409214ca5592cd92a114f7067febcba0c"}, - {file = "numpy-1.24.1-cp39-cp39-macosx_10_9_x86_64.whl", hash = "sha256:28bc9750ae1f75264ee0f10561709b1462d450a4808cd97c013046073ae64ab6"}, - {file = "numpy-1.24.1-cp39-cp39-macosx_11_0_arm64.whl", hash = "sha256:84e789a085aabef2f36c0515f45e459f02f570c4b4c4c108ac1179c34d475ed7"}, - {file = "numpy-1.24.1-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:8e669fbdcdd1e945691079c2cae335f3e3a56554e06bbd45d7609a6cf568c700"}, - {file = "numpy-1.24.1-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:ef85cf1f693c88c1fd229ccd1055570cb41cdf4875873b7728b6301f12cd05bf"}, - {file = "numpy-1.24.1-cp39-cp39-win32.whl", hash = "sha256:87a118968fba001b248aac90e502c0b13606721b1343cdaddbc6e552e8dfb56f"}, - {file = "numpy-1.24.1-cp39-cp39-win_amd64.whl", hash = "sha256:ddc7ab52b322eb1e40521eb422c4e0a20716c271a306860979d450decbb51b8e"}, - {file = "numpy-1.24.1-pp38-pypy38_pp73-macosx_10_9_x86_64.whl", hash = "sha256:ed5fb71d79e771ec930566fae9c02626b939e37271ec285e9efaf1b5d4370e7d"}, - {file = "numpy-1.24.1-pp38-pypy38_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:ad2925567f43643f51255220424c23d204024ed428afc5aad0f86f3ffc080086"}, - {file = "numpy-1.24.1-pp38-pypy38_pp73-win_amd64.whl", hash = "sha256:cfa1161c6ac8f92dea03d625c2d0c05e084668f4a06568b77a25a89111621566"}, - {file = "numpy-1.24.1.tar.gz", hash = "sha256:2386da9a471cc00a1f47845e27d916d5ec5346ae9696e01a8a34760858fe9dd2"}, -] -packaging = [ - {file = "packaging-23.0-py3-none-any.whl", hash = "sha256:714ac14496c3e68c99c29b00845f7a2b85f3bb6f1078fd9f72fd20f0570002b2"}, - {file = "packaging-23.0.tar.gz", hash = "sha256:b6ad297f8907de0fa2fe1ccbd26fdaf387f5f47c7275fedf8cce89f99446cf97"}, -] -pluggy = [ - {file = "pluggy-1.0.0-py2.py3-none-any.whl", hash = "sha256:74134bbf457f031a36d68416e1509f34bd5ccc019f0bcc952c7b909d06b37bd3"}, - {file = "pluggy-1.0.0.tar.gz", hash = "sha256:4224373bacce55f955a878bf9cfa763c1e360858e330072059e10bad68531159"}, -] -pytest = [ - {file = "pytest-7.2.1-py3-none-any.whl", hash = "sha256:c7c6ca206e93355074ae32f7403e8ea12163b1163c976fee7d4d84027c162be5"}, - {file = "pytest-7.2.1.tar.gz", hash = "sha256:d45e0952f3727241918b8fd0f376f5ff6b301cc0777c6f9a556935c92d8a7d42"}, -] -tomli = [ +files = [ {file = "tomli-2.0.1-py3-none-any.whl", hash = "sha256:939de3e7a6161af0c887ef91b7d41a53e7c5a1ca976325f429cb46ea9bc30ecc"}, {file = "tomli-2.0.1.tar.gz", hash = "sha256:de526c12914f0c550d15924c62d72abc48d6fe7364aa87328337a31007fe8a4f"}, ] + +[metadata] +lock-version = "2.0" +python-versions = "^3.9,<3.13" +content-hash = "aa27aa586ebf5e13d1936db455cb5da27cc641ae1ffc6434877928a3baa9bb82" diff --git a/pyproject.toml b/pyproject.toml index 6ebe666..29de9fc 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -13,14 +13,11 @@ include = [ ] [tool.poetry.dependencies] -python = "^3.9" -numpy = [ - { version = "^1.21.5", python = ">=3.7,<3.11" }, - { version = "^1.22.0", python = "^3.11" } -] +python = "^3.9,<3.13" +numpy = "^1.26.1" -[tool.poetry.dev-dependencies] -pytest = "^7.0.1" +[tool.poetry.group.test.dependencies] +pytest = "^7.4.3" [build-system] requires = ["poetry-core"] From bd190dec27c1e43542e9e7ea7adf8183957e20e8 Mon Sep 17 00:00:00 2001 From: zStupan Date: Sun, 5 Nov 2023 20:16:06 +0100 Subject: [PATCH 09/41] Added command line interface --- fireflyalgorithm/__init__.py | 4 +- fireflyalgorithm/__main__.py | 6 +++ fireflyalgorithm/cli.py | 79 ++++++++++++++++++++++++++++++++++++ pyproject.toml | 3 ++ 4 files changed, 90 insertions(+), 2 deletions(-) create mode 100644 fireflyalgorithm/__main__.py create mode 100644 fireflyalgorithm/cli.py diff --git a/fireflyalgorithm/__init__.py b/fireflyalgorithm/__init__.py index 48f3ef7..cb5e64a 100644 --- a/fireflyalgorithm/__init__.py +++ b/fireflyalgorithm/__init__.py @@ -1,5 +1,5 @@ from fireflyalgorithm.fireflyalgorithm import FireflyAlgorithm -__all__ = ['FireflyAlgorithm'] +__all__ = ["FireflyAlgorithm"] -__version__ = '0.3.4' +__version__ = "0.3.4" diff --git a/fireflyalgorithm/__main__.py b/fireflyalgorithm/__main__.py new file mode 100644 index 0000000..75c1ac9 --- /dev/null +++ b/fireflyalgorithm/__main__.py @@ -0,0 +1,6 @@ +import sys +from fireflyalgorithm import cli + + +if __name__ == "__main__": + sys.exit(cli.main()) diff --git a/fireflyalgorithm/cli.py b/fireflyalgorithm/cli.py new file mode 100644 index 0000000..b08d4fd --- /dev/null +++ b/fireflyalgorithm/cli.py @@ -0,0 +1,79 @@ +import argparse +import numpy as np +from fireflyalgorithm.problems import PROBLEMS, get_problem +from fireflyalgorithm.fireflyalgorithm import FireflyAlgorithm + + +def get_parser(): + parser = argparse.ArgumentParser( + prog="firefly-algorithm", + description="Evaluate the Firefly Algorithm on one or more test functions", + ) + + problem_functions = list(PROBLEMS.keys()) + parser.add_argument( + "--problem", + type=str, + required=True, + choices=problem_functions, + metavar="PROBLEM", + help="Test problem to evaluate", + ) + parser.add_argument( + "-d", "--dimension", type=int, required=True, help="Dimension of the problem" + ) + parser.add_argument( + "-l", "--lower", type=float, required=True, help="Lower bounds of the problem" + ) + parser.add_argument( + "-u", "--upper", type=float, required=True, help="Upper bounds of the problem" + ) + parser.add_argument( + "-nfes", + "--max-evals", + type=int, + required=True, + help="Max number of fitness function evaluations", + ) + parser.add_argument( + "-r", "--runs", type=int, default=1, help="Number of runs of the algorithm" + ) + parser.add_argument("--pop-size", type=int, default=20, help="Population size") + parser.add_argument("--alpha", type=float, default=1.0, help="Randomness strength") + parser.add_argument( + "--beta-min", type=float, default=1.0, help="Attractiveness constant" + ) + parser.add_argument( + "--gamma", type=float, default=0.01, help="Absorption coefficient" + ) + parser.add_argument("--seed", type=int, help="Seed for the random number generator") + return parser + + +def main(): + parser = get_parser() + args = parser.parse_args() + + algorithm = FireflyAlgorithm( + args.pop_size, args.alpha, args.beta_min, args.gamma, args.seed + ) + problem = get_problem(args.problem) + dim = args.dimension + lb = args.lower + ub = args.upper + max_evals = args.max_evals + runs = args.runs + + fitness = np.empty(runs) + for i in range(runs): + fitness[i] = algorithm.run(problem, dim, lb, ub, max_evals) + + if runs == 1: + print(f"Best fitness: {fitness[0]}") + else: + print(f"Best: {fitness.min()}") + print(f"Worst: {fitness.max()}") + print(f"Mean: {fitness.mean()}") + print(f"Std: {fitness.std()}") + + return 0 diff --git a/pyproject.toml b/pyproject.toml index 29de9fc..5051837 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -19,6 +19,9 @@ numpy = "^1.26.1" [tool.poetry.group.test.dependencies] pytest = "^7.4.3" +[tool.poetry.scripts] +firefly-algorithm = 'fireflyalgorithm.cli:main' + [build-system] requires = ["poetry-core"] build-backend = "poetry.core.masonry.api" From a0fa93d6968e3be1472dce1c87c7ffa24d4e3f1b Mon Sep 17 00:00:00 2001 From: zStupan Date: Sun, 5 Nov 2023 20:25:35 +0100 Subject: [PATCH 10/41] Update README.md --- README.md | 41 +++++++++++++++++++++++++++++++++++++---- 1 file changed, 37 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index c325acc..8516155 100644 --- a/README.md +++ b/README.md @@ -41,11 +41,8 @@ $ yay -Syyu python-fireflyalgorithm ## Usage: ```python -import numpy as np from fireflyalgorithm import FireflyAlgorithm - -def sphere(x): - return np.sum(x ** 2) +from fireflyalgorithm.problems import sphere FA = FireflyAlgorithm() best = FA.run(function=sphere, dim=10, lb=-5, ub=5, max_evals=10000) @@ -53,6 +50,42 @@ best = FA.run(function=sphere, dim=10, lb=-5, ub=5, max_evals=10000) print(best) ``` +### Command line interface + +The package also comes with a simple command line interface which allows you to evaluate the algorithm on several +popular test functions + +```shell +firefly-algorithm -h +``` + +```text +usage: firefly-algorithm [-h] --problem PROBLEM -d DIMENSION -l LOWER -u UPPER -nfes MAX_EVALS [-r RUNS] [--pop-size POP_SIZE] [--alpha ALPHA] [--beta-min BETA_MIN] [--gamma GAMMA] [--seed SEED] + +Evaluate the Firefly Algorithm on one or more test functions + +options: + -h, --help show this help message and exit + --problem PROBLEM Test problem to evaluate + -d DIMENSION, --dimension DIMENSION + Dimension of the problem + -l LOWER, --lower LOWER + Lower bounds of the problem + -u UPPER, --upper UPPER + Upper bounds of the problem + -nfes MAX_EVALS, --max-evals MAX_EVALS + Max number of fitness function evaluations + -r RUNS, --runs RUNS Number of runs of the algorithm + --pop-size POP_SIZE Population size + --alpha ALPHA Randomness strength + --beta-min BETA_MIN Attractiveness constant + --gamma GAMMA Absorption coefficient + --seed SEED Seed for the random number generator +``` + +**Note:** The CLI script can also run as a python module (python -m niaarm ...) + + ## Reference Papers: I. Fister Jr., X.-S. Yang, I. Fister, J. Brest. [Memetic firefly algorithm for combinatorial optimization](http://www.iztok-jr-fister.eu/static/publications/44.pdf) in Bioinspired Optimization Methods and their Applications (BIOMA 2012), B. Filipic and J.Silc, Eds. From 2900c9e850c0c8ea757d30973ebf405bae668683 Mon Sep 17 00:00:00 2001 From: zStupan Date: Sun, 5 Nov 2023 22:21:04 +0100 Subject: [PATCH 11/41] add tests --- tests/test_firefly.py | 11 +-- tests/test_problems.py | 214 +++++++++++++++++++++++++++++++++++++++++ 2 files changed, 217 insertions(+), 8 deletions(-) create mode 100644 tests/test_problems.py diff --git a/tests/test_firefly.py b/tests/test_firefly.py index cc048b7..3a05a3d 100644 --- a/tests/test_firefly.py +++ b/tests/test_firefly.py @@ -1,15 +1,10 @@ from unittest import TestCase - -import numpy as np from fireflyalgorithm import FireflyAlgorithm - -def sphere(x): - return np.sum(x ** 2) +from fireflyalgorithm.problems import sphere class TestFA(TestCase): - def test_algorithm(self): - FA = FireflyAlgorithm() - best = FA.run(function=sphere, dim=10, lb=-5, ub=5, max_evals=10000) + algorithm = FireflyAlgorithm() + best = algorithm.run(function=sphere, dim=10, lb=-5, ub=5, max_evals=10000) self.assertLess(best, 5) diff --git a/tests/test_problems.py b/tests/test_problems.py new file mode 100644 index 0000000..7ced6bb --- /dev/null +++ b/tests/test_problems.py @@ -0,0 +1,214 @@ +from unittest import TestCase +import numpy as np +from fireflyalgorithm.problems import ( + get_problem, + ackley, + alpine1, + alpine2, + cigar, + cosine_mixture, + csendes, + dixon_price, + griewank, + katsuura, + levy, + michalewicz, + perm1, + perm2, + pinter, + powell, + quing, + quintic, + rastrigin, + rosenbrock, + salomon, + schaffer2, + schaffer4, + schwefel, + schwefel21, + schwefel22, + sphere, + step, + step2, + styblinski_tang, + trid, + weierstrass, + whitley, + zakharov, +) + + +class TestProblems(TestCase): + def test_problem_factory(self): + self.assertRaises(KeyError, get_problem, "spherekjl2") + self.assertEqual(get_problem("ackley"), ackley) + self.assertEqual(get_problem("alpine1"), alpine1) + self.assertEqual(get_problem("alpine2"), alpine2) + self.assertEqual(get_problem("cigar"), cigar) + self.assertEqual(get_problem("cosine_mixture"), cosine_mixture) + self.assertEqual(get_problem("csendes"), csendes) + self.assertEqual(get_problem("dixon_price"), dixon_price) + self.assertEqual(get_problem("griewank"), griewank) + self.assertEqual(get_problem("katsuura"), katsuura) + self.assertEqual(get_problem("levy"), levy) + self.assertEqual(get_problem("michalewicz"), michalewicz) + self.assertEqual(get_problem("perm1"), perm1) + self.assertEqual(get_problem("perm2"), perm2) + self.assertEqual(get_problem("pinter"), pinter) + self.assertEqual(get_problem("powell"), powell) + self.assertEqual(get_problem("quing"), quing) + self.assertEqual(get_problem("quintic"), quintic) + self.assertEqual(get_problem("rastrigin"), rastrigin) + self.assertEqual(get_problem("rosenbrock"), rosenbrock) + self.assertEqual(get_problem("salomon"), salomon) + self.assertEqual(get_problem("schaffer2"), schaffer2) + self.assertEqual(get_problem("schaffer4"), schaffer4) + self.assertEqual(get_problem("schwefel"), schwefel) + self.assertEqual(get_problem("schwefel21"), schwefel21) + self.assertEqual(get_problem("schwefel22"), schwefel22) + self.assertEqual(get_problem("sphere"), sphere) + self.assertEqual(get_problem("step"), step) + self.assertEqual(get_problem("step2"), step2) + self.assertEqual(get_problem("styblinski_tang"), styblinski_tang) + self.assertEqual(get_problem("trid"), trid) + self.assertEqual(get_problem("weierstrass"), weierstrass) + self.assertEqual(get_problem("whitley"), whitley) + self.assertEqual(get_problem("zakharov"), zakharov) + + def test_ackley(self): + x = np.zeros(5) + self.assertAlmostEqual(ackley(x), 0.0) + + def test_alpine1(self): + x = np.zeros(5) + self.assertAlmostEqual(alpine1(x), 0.0) + + def test_alpine2(self): + x = np.full(5, 7.9170526982459462172) + self.assertAlmostEqual(alpine2(x), 2.8081311800070053291**5) + + def test_cigar(self): + x = np.zeros(5) + self.assertAlmostEqual(cigar(x), 0.0) + + def test_cosine_mixture(self): + x = np.zeros(5) + self.assertAlmostEqual(cosine_mixture(x), -0.5) + + def test_csendes(self): + x = np.zeros(5) + self.assertAlmostEqual(csendes(x), 0.0) + + def test_dixon_price(self): + x = np.array([2 ** -((2**i - 2) / 2**i) for i in range(1, 6)]) + self.assertAlmostEqual(dixon_price(x), 0.0) + + def test_griewank(self): + x = np.zeros(5) + self.assertAlmostEqual(griewank(x), 0.0) + + def test_katsuura(self): + x = np.zeros(5) + self.assertAlmostEqual(katsuura(x), 1.0) + + def test_levy(self): + x = np.full(5, 1) + self.assertAlmostEqual(levy(x), 0.0) + + def test_michalewicz(self): + x = np.array([2.20290552014618, 1.57079632677565]) + self.assertAlmostEqual(michalewicz(x), -1.80130341009855321) + + def test_perm1(self): + x = np.arange(1, 6) + self.assertAlmostEqual(perm1(x), 0.0) + + def test_perm2(self): + x = 1 / np.arange(1, 6) + self.assertAlmostEqual(perm2(x), 0.0) + + def test_pinter(self): + x = np.zeros(5) + self.assertAlmostEqual(pinter(x), 0.0) + + def test_powell(self): + x = np.zeros(5) + self.assertAlmostEqual(powell(x), 0.0) + + def test_quing(self): + x = np.sqrt(np.arange(1, 6)) + self.assertAlmostEqual(quing(x), 0.0) + + def test_quintic(self): + x = np.full(5, -1) + self.assertAlmostEqual(quintic(x), 0.0) + + def test_rastrigin(self): + x = np.zeros(5) + self.assertAlmostEqual(rastrigin(x), 0.0) + + def test_rosenbrock(self): + x = np.full(5, 1) + self.assertAlmostEqual(rosenbrock(x), 0.0) + + def test_salomon(self): + x = np.zeros(5) + self.assertAlmostEqual(rastrigin(x), 0.0) + + def test_schaffer2(self): + x = np.zeros(5) + self.assertAlmostEqual(schaffer2(x), 0.0) + + def test_schaffer4(self): + x1 = np.array([0, 1.253131828792882]) + x2 = np.array([0, -1.253131828792882]) + x3 = np.array([1.253131828792882, 0]) + x4 = np.array([-1.253131828792882, 0]) + self.assertAlmostEqual(schaffer4(x1), 0.292578632035980) + self.assertAlmostEqual(schaffer4(x2), 0.292578632035980) + self.assertAlmostEqual(schaffer4(x3), 0.292578632035980) + self.assertAlmostEqual(schaffer4(x4), 0.292578632035980) + + def test_schwefel(self): + x = np.full(5, 420.968746) + self.assertAlmostEqual(schwefel(x), 0.0) + + def test_schwefel21(self): + x = np.zeros(5) + self.assertAlmostEqual(schwefel21(x), 0.0) + + def test_schwefel22(self): + x = np.zeros(5) + self.assertAlmostEqual(schwefel22(x), 0.0) + + def test_sphere(self): + x = np.zeros(5) + self.assertAlmostEqual(sphere(x), 0.0) + + def test_step(self): + x = np.full(5, 0.5) + self.assertAlmostEqual(step(x), 0.0) + + def test_step2(self): + x = np.full(5, 0.5) + self.assertAlmostEqual(step(x), 0.0) + + def test_styblinski_tang(self): + x = np.full(5, -2.903534018185960) + self.assertAlmostEqual(styblinski_tang(x), -39.16616570377142 * 5) + + def test_trid(self): + x = np.array([6, 10, 12, 12, 10, 6]) + self.assertAlmostEqual(trid(x), -50) + + def test_weierstrass(self): + x = np.zeros(5) + self.assertAlmostEqual(weierstrass(x), 0.0) + + def test_whitley(self): + x = np.full(5, 1) + self.assertAlmostEqual(whitley(x), 0.0) + + def test_zakharov(self): + x = np.zeros(5) + self.assertAlmostEqual(zakharov(x), 0.0) From 3987b11965d7bab0e531ca6a768f53a3bb96b2f5 Mon Sep 17 00:00:00 2001 From: zStupan Date: Sun, 5 Nov 2023 22:22:49 +0100 Subject: [PATCH 12/41] minor fixes --- .github/workflows/test.yml | 2 +- examples/run.py | 6 +----- fireflyalgorithm/problems.py | 6 ++++-- 3 files changed, 6 insertions(+), 8 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index bebce77..493457e 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -13,7 +13,7 @@ jobs: strategy: matrix: os: [ubuntu-latest, windows-latest, macos-latest] - python-version: ['3.9', '3.10'] + python-version: ['3.9', '3.10', '3.11', '3.12'] defaults: run: shell: bash diff --git a/examples/run.py b/examples/run.py index 8597751..645070a 100644 --- a/examples/run.py +++ b/examples/run.py @@ -1,9 +1,5 @@ -import numpy as np from fireflyalgorithm import FireflyAlgorithm - - -def sphere(x): - return np.sum(x ** 2) +from fireflyalgorithm.problems import sphere FA = FireflyAlgorithm() diff --git a/fireflyalgorithm/problems.py b/fireflyalgorithm/problems.py index e0747e6..20a412d 100644 --- a/fireflyalgorithm/problems.py +++ b/fireflyalgorithm/problems.py @@ -56,7 +56,7 @@ def katsuura(x): dim = len(x) k = np.atleast_2d(np.arange(1, 33)).T i = np.arange(0, dim * 1) - inner = np.round(2**k * x) * (2 ** (-k)) + inner = np.round(2**k * x) * (2.0 ** (-k)) return np.prod(np.sum(inner, axis=0) * (i + 1) + 1) @@ -165,7 +165,9 @@ def schaffer4(x): def schwefel(x): dim = len(x) - return 418.9829 * dim - np.sum(x * np.sin(np.sqrt(np.abs(x)))) + return 418.982887272433799807913601398 * dim - np.sum( + x * np.sin(np.sqrt(np.abs(x))) + ) def schwefel21(x): From da5f882076f159d0e66db8f19e1f229208b523cc Mon Sep 17 00:00:00 2001 From: Iztok Fister Jr Date: Mon, 6 Nov 2023 09:27:00 +0100 Subject: [PATCH 13/41] bump version to 0.4.0 --- fireflyalgorithm/__init__.py | 2 +- pyproject.toml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/fireflyalgorithm/__init__.py b/fireflyalgorithm/__init__.py index cb5e64a..627a2d6 100644 --- a/fireflyalgorithm/__init__.py +++ b/fireflyalgorithm/__init__.py @@ -2,4 +2,4 @@ __all__ = ["FireflyAlgorithm"] -__version__ = "0.3.4" +__version__ = "0.4.0" diff --git a/pyproject.toml b/pyproject.toml index 5051837..9476ee2 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [tool.poetry] name = "fireflyalgorithm" -version = "0.3.4" +version = "0.4.0" description = "Implementation of Firefly Algorithm in Python" authors = ["Iztok Fister Jr. ", "Luka Pečnik ", "Žiga Stupan "] license = "MIT" From 09872a6aeaf70195d6e56efaa4d278a3f240bd5e Mon Sep 17 00:00:00 2001 From: zStupan <48752988+zStupan@users.noreply.github.com> Date: Mon, 6 Nov 2023 12:53:45 +0100 Subject: [PATCH 14/41] Fix typos --- fireflyalgorithm/problems.py | 4 ++-- tests/test_problems.py | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/fireflyalgorithm/problems.py b/fireflyalgorithm/problems.py index 20a412d..580cac7 100644 --- a/fireflyalgorithm/problems.py +++ b/fireflyalgorithm/problems.py @@ -124,7 +124,7 @@ def powell(x): return np.sum(term1 + term2 + term3 + term4) -def quing(x): +def qing(x): dim = len(x) return np.sum(np.power(x**2 - np.arange(1, dim + 1), 2)) @@ -245,7 +245,7 @@ def zakharov(x): "perm2": perm2, "pinter": pinter, "powell": powell, - "quing": quing, + "qing": qing, "quintic": quintic, "rastrigin": rastrigin, "rosenbrock": rosenbrock, diff --git a/tests/test_problems.py b/tests/test_problems.py index 7ced6bb..c28c47b 100644 --- a/tests/test_problems.py +++ b/tests/test_problems.py @@ -56,7 +56,7 @@ def test_problem_factory(self): self.assertEqual(get_problem("perm2"), perm2) self.assertEqual(get_problem("pinter"), pinter) self.assertEqual(get_problem("powell"), powell) - self.assertEqual(get_problem("quing"), quing) + self.assertEqual(get_problem("qing"), qing) self.assertEqual(get_problem("quintic"), quintic) self.assertEqual(get_problem("rastrigin"), rastrigin) self.assertEqual(get_problem("rosenbrock"), rosenbrock) @@ -135,7 +135,7 @@ def test_powell(self): x = np.zeros(5) self.assertAlmostEqual(powell(x), 0.0) - def test_quing(self): + def test_qing(self): x = np.sqrt(np.arange(1, 6)) self.assertAlmostEqual(quing(x), 0.0) From f55809e6a684b67a80d46a39cf71ac243c3e4a1d Mon Sep 17 00:00:00 2001 From: zStupan <48752988+zStupan@users.noreply.github.com> Date: Mon, 6 Nov 2023 12:56:04 +0100 Subject: [PATCH 15/41] fix typos --- tests/test_problems.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/test_problems.py b/tests/test_problems.py index c28c47b..4f5c93f 100644 --- a/tests/test_problems.py +++ b/tests/test_problems.py @@ -137,7 +137,7 @@ def test_powell(self): def test_qing(self): x = np.sqrt(np.arange(1, 6)) - self.assertAlmostEqual(quing(x), 0.0) + self.assertAlmostEqual(qing(x), 0.0) def test_quintic(self): x = np.full(5, -1) From 3b414d19f357938caca01c14967d238c9198164a Mon Sep 17 00:00:00 2001 From: zStupan <48752988+zStupan@users.noreply.github.com> Date: Mon, 6 Nov 2023 12:57:13 +0100 Subject: [PATCH 16/41] fix typos --- tests/test_problems.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/test_problems.py b/tests/test_problems.py index 4f5c93f..e00e479 100644 --- a/tests/test_problems.py +++ b/tests/test_problems.py @@ -17,7 +17,7 @@ perm2, pinter, powell, - quing, + qing, quintic, rastrigin, rosenbrock, From dd8f1a18812a0460882c8c534813c579a131de7f Mon Sep 17 00:00:00 2001 From: zStupan Date: Tue, 7 Nov 2023 15:42:21 +0100 Subject: [PATCH 17/41] added test problem definitions --- Problems.md | 389 ++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 389 insertions(+) create mode 100644 Problems.md diff --git a/Problems.md b/Problems.md new file mode 100644 index 0000000..84e1e95 --- /dev/null +++ b/Problems.md @@ -0,0 +1,389 @@ +# Test Functions + +Bellow You'll find the definitions of all the test functions implemented in this package. + +## Ackley +***Function name:*** `ackley` + +```math +f(x) = -20 e^{-0.2 \sqrt{\frac{1}{D} \sum_{i=1}^D x_i^2}} - e^{\frac{1}{D} \sum_{i=1}^D \cos(2 \pi x_i)} + 20 + e +``` + +**Dimensions:** $D$ + +**Global optimum:** $`f(x^*) = 0`$ for $`x_i^* = 0`$ + +## Alpine 1 +***Function name:*** `alpine1` + +```math +f(x) = \sum_{i=1}^{D} \lvert {x_i \sin \left( x_i \right) + 0.1 x_i} \rvert +``` + +**Dimensions:** $D$ + +**Global optimum:** $`f(x^*) = 0`$ for $`x_i^* = 0`$ + +## Alpine 2 +***Function name:*** `alpine2` + +```math +f(x) = \prod_{i=1}^{D} \sqrt{x_i} \sin(x_i) +``` + +**Dimensions:** $D$ + +**Global optimum:** $`f(x^*) = 2.808^D`$ for $`x_i^* = 7.917`$ + +## Cigar +***Function name:*** `cigar` + +```math +f(x) = x_1^2 + 10^6\sum_{i=2}^{D} x_i^2 +``` + +**Dimensions:** $D$ + +**Global optimum:** $`f(x^*) = 0`$ for $`x_i^* = 0`$ + +## Cosine Mixture +***Function name:*** `cosine_mixture` + +```math +f(x) = -0.1 \sum_{i=1}^D \cos (5 \pi x_i) - \sum_{i=1}^D x_i^2 +``` + +**Dimensions:** $D$ + +**Global optimum:** $`f(x^*) = -0.1 D`$ for $`x_i^* = 0`$ + +## Csendes +***Function name:*** `csendes` + +```math +f(x) = \sum_{i=1}^D x_i^6 \left( 2 + \sin \frac{1}{x_i}\right) +``` + +**Dimensions:** $D$ + +**Global optimum:** $`f(x^*) = 0`$ for $`x_i^* = 0`$ + +## Dixon-Price +***Function name:*** `dixon_price` + +```math +f(x) = (x_1 - 1)^2 + \sum_{i = 2}^D i (2x_i^2 - x_{i - 1})^2 +``` + +**Dimensions:** $D$ + +**Global optimum:** $`f(x^*) = 0`$ for $`x_i^* = 2^{- \frac{(2^i - 2)}{2^i}}`$ + +## Griewank +***Function name:*** `griewank` + +```math +f(x) = \sum_{i=1}^D \frac{x_i^2}{4000} - \prod_{i=1}^D \cos(\frac{x_i}{\sqrt{i}}) + 1 +``` + +**Dimensions:** $D$ + +**Global optimum:** $`f(x^*) = 0`$ for $`x_i^* = 0`$ + +## Katsuura +***Function name:*** `katsuura` + +```math +\prod_{i=1}^D \left(1 + i \sum_{j=1}^{32} \frac{\lvert 2^j x_i - round\left(2^j x_i \right) \rvert}{2^j} \right) +``` + +**Dimensions:** $D$ + +**Global optimum:** $`f(x^*) = 1`$ for $`x_i^* = 0`$ + +## Levy +***Function name:*** `levy` + +```math + \begin{gather} + \sin^2 (\pi w_1) + \sum_{i = 1}^{D - 1} (w_i - 1)^2 \left( 1 + 10 \sin^2 (\pi w_i + 1) \right) + (w_d - 1)^2 (1 + \sin^2 (2 \pi w_d)),\,\text{where}\\ + w_i = 1 + \frac{x_i - 1}{4},\, \text{for all } i = 1, \ldots, D + \end{gather} + +``` + +**Dimensions:** $D$ + +**Global optimum:** $`f(x^*) = 0`$ for $`x_i^* = 1`$ + +## Michalewicz +***Function name:*** `michalewicz` + +```math +f(x) = - \sum_{i = 1}^{D} \sin(x_i) \sin^{2m}\left( \frac{ix_i^2}{\pi} \right) +``` + +**Dimensions:** $D$ + +**Global optimum:** $`\text{at } D=2,\,f(x^*) = -1.8013`$ for $`x^* = (2.20, 1.57)`$ + +## Perm 1 +***Function name:*** `perm1` + +```math +f(x) = \sum_{i = 1}^D \left( \sum_{j = 1}^D (j^i + \beta) \left( \left(\frac{x_j}{j}\right)^i - 1 \right) \right)^2 +``` + +**Dimensions:** $D$ + +**Global optimum:** $`f(x^*) = 0`$ for $`x_i^* = i`$ + +## Perm 2 +***Function name:*** `perm2` + +```math +f(x) = \sum_{i = 1}^D \left( \sum_{j = 1}^D (j - \beta) \left( x_j^i - \frac{1}{j^i} \right) \right)^2 +``` + +**Dimensions:** $D$ + +**Global optimum:** $`f(x^*) = 0`$ for $`x_i^* = \frac{1}{i}`$ + +## Pinter +***Function name:*** `pinter` + +```math +\begin{equation} +f(\mathbf{x}) = +\sum_{i=1}^D ix_i^2 + \sum_{i=1}^D 20i \sin^2 A + \sum_{i=1}^D i \log_{10} (1 + iB^2),\, \text{where} +\end{equation} + +\begin{align} +A &= (x_{i-1}\sin(x_i)+\sin(x_{i+1})) \\ +B &= (x_{i-1}^2 - 2x_i + 3x_{i+1} - \cos(x_i) + 1) +\end{align} +``` + +**Dimensions:** $D$ + +**Global optimum:** $`f(x^*) = 0`$ for $`x_i^* = 0`$ + +## Powell +***Function name:*** `powell` + +```math +f(x) = \sum_{i = 1}^{D/4} \left[ (x_{4 i - 3} + 10 x_{4 i - 2})^2 + 5 (x_{4 i - 1} - x_{4 i})^2 + (x_{4 i - 2} - 2 x_{4 i - 1})^4 + 10 (x_{4 i - 3} - x_{4 i})^4 \right] +``` + +**Dimensions:** $D$ + +**Global optimum:** $`f(x^*) = 0`$ for $`x_i^* = 0`$ + +## Qing +***Function name:*** `qing` + +```math +f(x) = \sum_{i=1}^D \left(x_i^2 - i\right)^2 +``` + +**Dimensions:** $D$ + +**Global optimum:** $`f(x^*) = 0`$ for $`x_i^* = \pm \sqrt{i}`$ + +## Quintic +***Function name:*** `quintic` + +```math +f(x) = \sum_{i=1}^D \left| x_i^5 - 3x_i^4 + 4x_i^3 + 2x_i^2 - 10x_i - 4\right| +``` + +**Dimensions:** $D$ + +**Global optimum:** $`f(x^*) = 0`$ for $`x_i^* = -1\quad \text{or} \quad x_i^* = 2`$ + +## Rastrigin +***Function name:*** `rastrigin` + +```math +f(x) = 10D + \sum_{i=1}^D \left[x_i^2 -10\cos(2\pi x_i)\right] +``` + +**Dimensions:** $D$ + +**Global optimum:** $`f(x^*) = 0`$ for $`x_i^* = 0`$ + +## Rosenbrock +***Function name:*** `rosenbrock` + +```math +f(x) = \sum_{i=1}^{D-1} \left[100 (x_{i+1} - x_i^2)^2 + (x_i - 1)^2 \right] +``` + +**Dimensions:** $D$ + +**Global optimum:** $`f(x^*) = 0`$ for $`x_i^* = 1`$ + +## Salomon +***Function name:*** `salomon` + +```math +f(x) = 1 - \cos\left(2\pi\sqrt{\sum_{i=1}^D x_i^2} \right)+ 0.1 \sqrt{\sum_{i=1}^D x_i^2} +``` + +**Dimensions:** $D$ + +**Global optimum:** $`f(x^*) = 0`$ for $`x_i^* = 0`$ + +## Schaffer 2 +***Function name:*** `schaffer2` + +```math +f(x) = 0.5 + \frac{ \sin^2 \left( x_1^2 - x_2^2 \right) - 0.5 }{ \left[ 1 + 0.001 \left( x_1^2 + x_2^2 \right) \right]^2 } +``` + +**Dimensions:** 2 + +**Global optimum:** $`f(x^*) = 0`$ for $`x^* = (0, 0)`$ + +## Schaffer 4 +***Function name:*** `schaffer4` + +```math +f(x) = 0.5 + \frac{ \cos^2 \left( \sin \left( \vert x_1^2 - x_2^2\vert \right) \right)- 0.5 }{ \left[ 1 + 0.001 \left( x_1^2 + x_2^2 \right) \right]^2 } +``` + +**Dimensions:** 2 + +**Global optimum:** $`f(x^*) = 0.292579`$ for $`x^* = (0, \pm 1.25313) \text{or} (\pm 1.25313, 0)`$ + +## Schwefel +***Function name:*** `schwefel` + +```math +f(x) = 418.9829D - \sum_{i=1}^{D} x_i \sin(\sqrt{\lvert x_i \rvert}) +``` + +**Dimensions:** $D$ + +**Global optimum:** $`f(x^*) = 0`$ for $`x_i^* = 420.9687`$ + +## Schwefel 2.21 +***Function name:*** `schwefel221` + +```math +f(x) = \max_{1 \leq i \leq D} \vert x_i\vert +``` + +**Dimensions:** $D$ + +**Global optimum:** $`f(x^*) = 0`$ for $`x_i^* = 0`$ + +## Schwefel 2.22 +***Function name:*** `schwefel222` + +```math +f(x) = \sum_{i=1}^{D} \lvert x_i \rvert +\prod_{i=1}^{D} \lvert x_i \rvert +``` + +**Dimensions:** $D$ + +**Global optimum:** $`f(x^*) = 0`$ for $`x_i^* = 0`$ + +## Sphere +***Function name:*** `sphere` + +```math +f(x) = \sum_{i=1}^D x_i^2 +``` + +**Dimensions:** $D$ + +**Global optimum:** $`f(x^*) = 0`$ for $`x_i^* = 0`$ + +## Step +***Function name:*** `step` + +```math +f(x) = \sum_{i=1}^D \left( \lfloor \lvert x_i \rvert \rfloor \right) +``` + +**Dimensions:** $D$ + +**Global optimum:** $`f(x^*) = 0`$ for $`x_i^* = 0`$ + +## Step 2 +***Function name:*** `step2` + +```math +f(x) = \sum_{i=1}^D \left( \lfloor x_i + 0.5 \rfloor \right)^2 +``` + +**Dimensions:** $D$ + +**Global optimum:** $`f(x^*) = 0`$ for $`x_i^* = -0.5`$ + +## Styblinski-Tang +***Function name:*** `styblinski_tang` + +```math + +``` + +**Dimensions:** $D$ + +**Global optimum:** $`f(x^*) = -39.16599 D`$ for $`x_i^* = -2.903534`$ + +## Trid +***Function name:*** `trid` + +```math +f(x) = \sum_{i = 1}^D \left( x_i - 1 \right)^2 - \sum_{i = 2}^D x_i x_{i - 1} +``` + +**Dimensions:** $D$ + +**Global optimum:** $`f(x^*) = \frac{-D (D + 4) (D - 1)}{6}`$ for $`x_i^* = i (d + 1 - i)`$ + +## Weierstrass +***Function name:*** `weierstrass` + +```math +f(x) = \sum_{i=1}^D \left[ \sum_{k=0}^{k_{max}} a^k \cos\left( 2 \pi b^k ( x_i + 0.5) \right) \right] - D \sum_{k=0}^{k_{max}} a^k \cos \left(\pi b^k \right) +``` + +**Dimensions:** $D$ + +**Global optimum:** $`f(x^*) = 0`$ for $`x_i^* = 0`$ + +## Whitley +***Function name:*** `whitley` + +```math +f(x) = \sum_{i=1}^D \sum_{j=1}^D \left[\frac{(100(x_i^2-x_j)^2 + (1-x_j)^2)^2}{4000} - \cos(100(x_i^2-x_j)^2 + (1-x_j)^2)+1\right] +``` + +**Dimensions:** $D$ + +**Global optimum:** $`f(x^*) = 0`$ for $`x_i^* = 1`$ + +## Zakharov +***Function name:*** `zakharov` + +```math +f(x) = \sum_{i = 1}^D x_i^2 + \left( \sum_{i = 1}^D 0.5 i x_i \right)^2 + \left( \sum_{i = 1}^D 0.5 i x_i \right)^4 +``` + +**Dimensions:** $D$ + +**Global optimum:** $`f(x^*) = 0`$ for $`x_i^* = 0`$ + + +# References + +[1] P. Ernesto and U. Diliman, [“MVF–Multivariate Test Functions Library in C for Unconstrained Global Optimization,”](http://www.geocities.ws/eadorio/mvf.pdf) University of the Philippines Diliman, Quezon City, 2005. + +[2] M. Jamil and X.-S. Yang, [“A literature survey of benchmark functions for global optimisation problems,”](https://arxiv.org/abs/1308.4008) International Journal of Mathematical Modelling and Numerical Optimisation, vol. 4, no. 2, p. 150, Jan. 2013, doi: 10.1504/ijmmno.2013.055204. + +[3] J. J. Liang, B. Y. Qu, and P. N. Suganthan, [“Problem definitions and evaluation criteria for the CEC 2014 special session and competition on single objective real-parameter numerical optimization,”](http://bee22.com/manual/tf_images/Liang%20CEC2014.pdf) Computational Intelligence Laboratory, Zhengzhou University, Zhengzhou China and Technical Report, Nanyang Technological University, Singapore, vol. 635, no. 2, 2013. + +[4] S. Surjanovic and D. Bingham, Virtual Library of Simulation Experiments: Test Functions and Datasets. Retrieved November 7, 2023, from https://www.sfu.ca/~ssurjano/. From 19d9807c61485f25dc1aa3c591ad106fca4a3724 Mon Sep 17 00:00:00 2001 From: zStupan Date: Tue, 7 Nov 2023 16:10:02 +0100 Subject: [PATCH 18/41] fix pinter formula --- Problems.md | 2 -- 1 file changed, 2 deletions(-) diff --git a/Problems.md b/Problems.md index 84e1e95..d19d0df 100644 --- a/Problems.md +++ b/Problems.md @@ -153,10 +153,8 @@ f(x) = \sum_{i = 1}^D \left( \sum_{j = 1}^D (j - \beta) \left( x_j^i - \frac{1} ***Function name:*** `pinter` ```math -\begin{equation} f(\mathbf{x}) = \sum_{i=1}^D ix_i^2 + \sum_{i=1}^D 20i \sin^2 A + \sum_{i=1}^D i \log_{10} (1 + iB^2),\, \text{where} -\end{equation} \begin{align} A &= (x_{i-1}\sin(x_i)+\sin(x_{i+1})) \\ From 89f02903bc602c3c48ce6b703bb8a40b6fb65905 Mon Sep 17 00:00:00 2001 From: zStupan <48752988+zStupan@users.noreply.github.com> Date: Tue, 7 Nov 2023 16:40:31 +0100 Subject: [PATCH 19/41] Update Problems.md - There were some rendering issues when doing \sqrt{\sum....} in ackley and salomon. Using \sum\nolimits instead. - Pinter was formatted wrong --- Problems.md | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/Problems.md b/Problems.md index d19d0df..7bb3ef6 100644 --- a/Problems.md +++ b/Problems.md @@ -6,7 +6,7 @@ Bellow You'll find the definitions of all the test functions implemented in this ***Function name:*** `ackley` ```math -f(x) = -20 e^{-0.2 \sqrt{\frac{1}{D} \sum_{i=1}^D x_i^2}} - e^{\frac{1}{D} \sum_{i=1}^D \cos(2 \pi x_i)} + 20 + e +f(x) = -20 e^{-0.2 \sqrt{D^{-1} \sum\nolimits_{i=1}^D x_i^2}} - e^{D^{-1} \sum\nolimits_{i=1}^D \cos(2 \pi x_i)} + 20 + e ``` **Dimensions:** $D$ @@ -153,9 +153,9 @@ f(x) = \sum_{i = 1}^D \left( \sum_{j = 1}^D (j - \beta) \left( x_j^i - \frac{1} ***Function name:*** `pinter` ```math -f(\mathbf{x}) = -\sum_{i=1}^D ix_i^2 + \sum_{i=1}^D 20i \sin^2 A + \sum_{i=1}^D i \log_{10} (1 + iB^2),\, \text{where} - +f(x) = \sum_{i=1}^D ix_i^2 + \sum_{i=1}^D 20i \sin^2 A + \sum_{i=1}^D i \log_{10} (1 + iB^2),\, \text{where} +``` +```math \begin{align} A &= (x_{i-1}\sin(x_i)+\sin(x_{i+1})) \\ B &= (x_{i-1}^2 - 2x_i + 3x_{i+1} - \cos(x_i) + 1) @@ -225,7 +225,7 @@ f(x) = \sum_{i=1}^{D-1} \left[100 (x_{i+1} - x_i^2)^2 + (x_i - 1)^2 \right] ***Function name:*** `salomon` ```math -f(x) = 1 - \cos\left(2\pi\sqrt{\sum_{i=1}^D x_i^2} \right)+ 0.1 \sqrt{\sum_{i=1}^D x_i^2} +f(x) = 1 - \cos\left(2\pi\sqrt{\sum\nolimits_{i=1}^D x_i^2} \right)+ 0.1 \sqrt{\sum\nolimits_{i=1}^D x_i^2} ``` **Dimensions:** $D$ From 582aeded15ac472d67cfe9987b98acea0f0a62e4 Mon Sep 17 00:00:00 2001 From: zStupan Date: Tue, 7 Nov 2023 16:42:37 +0100 Subject: [PATCH 20/41] minor fixes --- fireflyalgorithm/problems.py | 14 +++++++------- tests/test_problems.py | 16 ++++++++-------- 2 files changed, 15 insertions(+), 15 deletions(-) diff --git a/fireflyalgorithm/problems.py b/fireflyalgorithm/problems.py index 580cac7..c0718cc 100644 --- a/fireflyalgorithm/problems.py +++ b/fireflyalgorithm/problems.py @@ -55,9 +55,9 @@ def griewank(x): def katsuura(x): dim = len(x) k = np.atleast_2d(np.arange(1, 33)).T - i = np.arange(0, dim * 1) + i = np.arange(1, dim + 1) inner = np.round(2**k * x) * (2.0 ** (-k)) - return np.prod(np.sum(inner, axis=0) * (i + 1) + 1) + return np.prod(np.sum(inner, axis=0) * i + 1) def levy(x): @@ -158,7 +158,7 @@ def schaffer2(x): def schaffer4(x): return ( 0.5 - + (np.cos(np.sin(x[0] ** 2 - x[1] ** 2)) ** 2 - 0.5) + + (np.cos(np.sin(abs(x[0] ** 2 - x[1] ** 2))) ** 2 - 0.5) / (1 + 0.001 * (x[0] ** 2 + x[1] ** 2)) ** 2 ) @@ -170,11 +170,11 @@ def schwefel(x): ) -def schwefel21(x): +def schwefel221(x): return np.amax(np.abs(x)) -def schwefel22(x): +def schwefel222(x): return np.sum(np.abs(x)) + np.prod(np.abs(x)) @@ -253,8 +253,8 @@ def zakharov(x): "schaffer2": schaffer2, "schaffer4": schaffer4, "schwefel": schwefel, - "schwefel21": schwefel21, - "schwefel22": schwefel22, + "schwefel221": schwefel221, + "schwefel222": schwefel222, "sphere": sphere, "step": step, "step2": step2, diff --git a/tests/test_problems.py b/tests/test_problems.py index e00e479..c91fed9 100644 --- a/tests/test_problems.py +++ b/tests/test_problems.py @@ -25,8 +25,8 @@ schaffer2, schaffer4, schwefel, - schwefel21, - schwefel22, + schwefel221, + schwefel222, sphere, step, step2, @@ -64,8 +64,8 @@ def test_problem_factory(self): self.assertEqual(get_problem("schaffer2"), schaffer2) self.assertEqual(get_problem("schaffer4"), schaffer4) self.assertEqual(get_problem("schwefel"), schwefel) - self.assertEqual(get_problem("schwefel21"), schwefel21) - self.assertEqual(get_problem("schwefel22"), schwefel22) + self.assertEqual(get_problem("schwefel221"), schwefel221) + self.assertEqual(get_problem("schwefel222"), schwefel222) self.assertEqual(get_problem("sphere"), sphere) self.assertEqual(get_problem("step"), step) self.assertEqual(get_problem("step2"), step2) @@ -175,11 +175,11 @@ def test_schwefel(self): def test_schwefel21(self): x = np.zeros(5) - self.assertAlmostEqual(schwefel21(x), 0.0) + self.assertAlmostEqual(schwefel221(x), 0.0) def test_schwefel22(self): x = np.zeros(5) - self.assertAlmostEqual(schwefel22(x), 0.0) + self.assertAlmostEqual(schwefel222(x), 0.0) def test_sphere(self): x = np.zeros(5) @@ -190,8 +190,8 @@ def test_step(self): self.assertAlmostEqual(step(x), 0.0) def test_step2(self): - x = np.full(5, 0.5) - self.assertAlmostEqual(step(x), 0.0) + x = np.full(5, -0.5) + self.assertAlmostEqual(step2(x), 0.0) def test_styblinski_tang(self): x = np.full(5, -2.903534018185960) From 1397b1e6a55c3c85fece1c1baeabaa317ea40a4a Mon Sep 17 00:00:00 2001 From: zStupan Date: Tue, 7 Nov 2023 17:01:45 +0100 Subject: [PATCH 21/41] Update README.md --- README.md | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/README.md b/README.md index 8516155..9fcb701 100644 --- a/README.md +++ b/README.md @@ -50,6 +50,19 @@ best = FA.run(function=sphere, dim=10, lb=-5, ub=5, max_evals=10000) print(best) ``` +### Test functions + +In the `fireflyalgorithm.problems` module, you can find the implementations of 33 popular optimization test problems. Additionally, the module provides a utility function, `get_problem`, that allows you to retrieve a specific optimization problem function by providing its name as a string: + +```python +from fireflyalgorithm.problems import get_problem + +# same as from fireflyalgorithm.problems import rosenbrock +rosenbrock = get_problem('rosenbrock') +``` + +For more information about the implemented test functions, [click here](Problems.md) + ### Command line interface The package also comes with a simple command line interface which allows you to evaluate the algorithm on several From d380dd5705578045beef75e24efff039a607571d Mon Sep 17 00:00:00 2001 From: Iztok Fister Jr Date: Fri, 10 Nov 2023 09:36:33 +0100 Subject: [PATCH 22/41] bump version --- fireflyalgorithm/__init__.py | 2 +- pyproject.toml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/fireflyalgorithm/__init__.py b/fireflyalgorithm/__init__.py index 627a2d6..35ed0d4 100644 --- a/fireflyalgorithm/__init__.py +++ b/fireflyalgorithm/__init__.py @@ -2,4 +2,4 @@ __all__ = ["FireflyAlgorithm"] -__version__ = "0.4.0" +__version__ = "0.4.1" diff --git a/pyproject.toml b/pyproject.toml index 9476ee2..3fdb198 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [tool.poetry] name = "fireflyalgorithm" -version = "0.4.0" +version = "0.4.1" description = "Implementation of Firefly Algorithm in Python" authors = ["Iztok Fister Jr. ", "Luka Pečnik ", "Žiga Stupan "] license = "MIT" From ddaeff7cab66ca7f079c6a9fbea6817874568459 Mon Sep 17 00:00:00 2001 From: Iztok Fister Jr Date: Sat, 25 Nov 2023 21:22:42 +0100 Subject: [PATCH 23/41] Add installation instructions for Alpine --- README.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/README.md b/README.md index 9fcb701..8d0c1ee 100644 --- a/README.md +++ b/README.md @@ -37,6 +37,10 @@ To install FireflyAlgorithm on Arch Linux, please use an [AUR helper](https://wi ```sh $ yay -Syyu python-fireflyalgorithm ``` +To install FireflyAlgorithm on Alpine Linux: +```sh +$ apk add py3-fireflyalgorithm +``` ## Usage: From 8df73448b053186648e1e6905cb5f21541700ac1 Mon Sep 17 00:00:00 2001 From: "Iztok Fister Jr." Date: Sun, 3 Dec 2023 13:01:17 +0100 Subject: [PATCH 24/41] Update changelog --- CHANGELOG.md | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 18d1380..2964d4a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,34 @@ # Changelog +## [0.4.1](https://github.com/firefly-cpp/FireflyAlgorithm/tree/0.4.1) (2023-11-10) + +[Full Changelog](https://github.com/firefly-cpp/FireflyAlgorithm/compare/0.4.0...0.4.1) + +**Closed issues:** + +- Create Problems.md [\#18](https://github.com/firefly-cpp/FireflyAlgorithm/issues/18) + +**Merged pull requests:** + +- Add Test Function definitions [\#19](https://github.com/firefly-cpp/FireflyAlgorithm/pull/19) ([zStupan](https://github.com/zStupan)) + +## [0.4.0](https://github.com/firefly-cpp/FireflyAlgorithm/tree/0.4.0) (2023-11-06) + +[Full Changelog](https://github.com/firefly-cpp/FireflyAlgorithm/compare/0.3.4...0.4.0) + +**Closed issues:** + +- Enhance tests [\#16](https://github.com/firefly-cpp/FireflyAlgorithm/issues/16) +- Provide Command Line Interface \(CLI\) [\#13](https://github.com/firefly-cpp/FireflyAlgorithm/issues/13) +- Add installation instructions for Arch Linux [\#11](https://github.com/firefly-cpp/FireflyAlgorithm/issues/11) + +**Merged pull requests:** + +- Add tests [\#17](https://github.com/firefly-cpp/FireflyAlgorithm/pull/17) ([zStupan](https://github.com/zStupan)) +- Added a Command Line Interface [\#15](https://github.com/firefly-cpp/FireflyAlgorithm/pull/15) ([zStupan](https://github.com/zStupan)) +- Improve workflows [\#14](https://github.com/firefly-cpp/FireflyAlgorithm/pull/14) ([firefly-cpp](https://github.com/firefly-cpp)) +- Add instructions for install FireflyAlgorithm in Arch Linux [\#12](https://github.com/firefly-cpp/FireflyAlgorithm/pull/12) ([carlosal1015](https://github.com/carlosal1015)) + ## [0.3.4](https://github.com/firefly-cpp/FireflyAlgorithm/tree/0.3.4) (2022-12-13) [Full Changelog](https://github.com/firefly-cpp/FireflyAlgorithm/compare/0.3.3...0.3.4) From c44467e8b252a3293393f46fbb4c6af28e954865 Mon Sep 17 00:00:00 2001 From: Tadej Lahovnik Date: Mon, 4 Dec 2023 10:36:46 +0100 Subject: [PATCH 25/41] doc: Templates --- .github/templates/FEATURE_REQUEST.md | 16 ++++++++++++++++ .github/templates/ISSUE_TEMPLATE.md | 18 ++++++++++++++++++ .github/templates/PULL_REQUEST.md | 14 ++++++++++++++ 3 files changed, 48 insertions(+) create mode 100644 .github/templates/FEATURE_REQUEST.md create mode 100644 .github/templates/ISSUE_TEMPLATE.md create mode 100644 .github/templates/PULL_REQUEST.md diff --git a/.github/templates/FEATURE_REQUEST.md b/.github/templates/FEATURE_REQUEST.md new file mode 100644 index 0000000..5a1ccc4 --- /dev/null +++ b/.github/templates/FEATURE_REQUEST.md @@ -0,0 +1,16 @@ +### Feature Request + +**About**: +**Title**: + +**Is your feature request related to a problem? Please describe.** +A clear and concise description of what the problem is. Ex. I'm always frustrated when [...] + +**Describe the solution you'd like** +A clear and concise description of what you want to happen. + +**Describe alternatives you've considered** +A clear and concise description of any alternative solutions or features you've considered. + +**Additional context** +Add any other context or screenshots about the feature request here. \ No newline at end of file diff --git a/.github/templates/ISSUE_TEMPLATE.md b/.github/templates/ISSUE_TEMPLATE.md new file mode 100644 index 0000000..90325f5 --- /dev/null +++ b/.github/templates/ISSUE_TEMPLATE.md @@ -0,0 +1,18 @@ +### Bug Report + +**About**: +**Title**: + +**Steps to reproduce** +Tell us how to reproduce the bug. + +**Expected behavior** +Tell us what should happen. + +**Actual behavior** +Tell us what happens instead. + +**System configuration** + + - OS: + - Python version: \ No newline at end of file diff --git a/.github/templates/PULL_REQUEST.md b/.github/templates/PULL_REQUEST.md new file mode 100644 index 0000000..9a87d5d --- /dev/null +++ b/.github/templates/PULL_REQUEST.md @@ -0,0 +1,14 @@ +### Summary + +Provide a general description of the code changes in your pull +request... were there any bugs you had fixed? If so, mention them. If +these bugs have open GitHub issues, be sure to tag them here as well, +to keep the conversation linked together. + +### Other Information + +If there's anything else that's important and relevant to your pull +request, mention that information here. This could include +benchmarks, or other information. + +Thanks for contributing to Firefly Algorithm! \ No newline at end of file From 362c777e113913a14c5121ef6db12dc438c31059 Mon Sep 17 00:00:00 2001 From: Tadej Lahovnik Date: Mon, 4 Dec 2023 10:37:01 +0100 Subject: [PATCH 26/41] doc: Contribution guide --- CONTRIBUTING.md | 54 +++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 54 insertions(+) create mode 100644 CONTRIBUTING.md diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md new file mode 100644 index 0000000..6162d8d --- /dev/null +++ b/CONTRIBUTING.md @@ -0,0 +1,54 @@ +# Contributing to Firefly Algorithm +:+1::tada: First off, thanks for taking the time to contribute! :tada::+1: + +## Code of Conduct +This project and everyone participating in it is governed by the [Firefly Algorithm Code of Conduct](CODE_OF_CONDUCT.md). By participating, you are expected to uphold this code. Please report unacceptable behavior to [iztok.fister1@um.si](mailto:iztok.fister1@um.si). + +## How Can I Contribute? + +### Reporting Bugs +Before creating bug reports, please check existing issues list as you might find out that you don't need to create one. When you are creating a bug report, please include as many details as possible in the [issue template](.github/templates/ISSUE_TEMPLATE.md). + +### Suggesting Enhancements + +Open new issue using the [feature request template](.github/templates/FEATURE_REQUEST.md). + +### Pull requests + +Fill in the [pull request template](.github/templates/PULL_REQUEST.md) and make sure your code is documented. + +## Setup development environment + +### Requirements + +* Poetry: [https://python-poetry.org/docs](https://python-poetry.org/docs) + +After installing Poetry and cloning the project from GitHub, you should run the following command from the root of the cloned project: + +```sh +poetry install +``` + +All of the project's dependencies should be installed and the project ready for further development. **Note that Poetry creates a separate virtual environment for your project.** + +### Dependencies + +| Package | Version | Platform | +|----------|:-------:|:--------:| +| numpy | ^1.26.1 | All | + +#### Development dependencies + +| Package | Version | Platform | +|---------|:--------:|:--------:| +| pytest | ^7.4.3 | Any | + +## Development Tasks + +### Testing + +Manually run the tests: + +```sh +poetry run pytest +``` \ No newline at end of file From f89e607ea84b62ec4747b6bfb3cf4bbe3d0edd98 Mon Sep 17 00:00:00 2001 From: Tadej Lahovnik Date: Mon, 4 Dec 2023 10:40:47 +0100 Subject: [PATCH 27/41] doc: README --- README.md | 21 ++++++++++----------- 1 file changed, 10 insertions(+), 11 deletions(-) diff --git a/README.md b/README.md index 8d0c1ee..f0208fe 100644 --- a/README.md +++ b/README.md @@ -19,11 +19,11 @@ [![Percentage of issues still open](http://isitmaintained.com/badge/open/firefly-cpp/FireflyAlgorithm.svg)](http://isitmaintained.com/project/firefly-cpp/FireflyAlgorithm "Percentage of issues still open") ![GitHub contributors](https://img.shields.io/github/contributors/firefly-cpp/FireflyAlgorithm.svg) -## About +## About 📋 -This package implements a nature-inspired algorithm for optimization called Firefly Algorithm (FA) in Python programming language. +This package implements a nature-inspired algorithm for optimization called Firefly Algorithm (FA) in Python programming language. 🌿🔍💻 -## Installation: +## Installation 📦 Install FireflyAlgorithm with pip: ```sh @@ -42,7 +42,7 @@ To install FireflyAlgorithm on Alpine Linux: $ apk add py3-fireflyalgorithm ``` -## Usage: +## Usage 🚀 ```python from fireflyalgorithm import FireflyAlgorithm @@ -54,7 +54,7 @@ best = FA.run(function=sphere, dim=10, lb=-5, ub=5, max_evals=10000) print(best) ``` -### Test functions +### Test functions 📈 In the `fireflyalgorithm.problems` module, you can find the implementations of 33 popular optimization test problems. Additionally, the module provides a utility function, `get_problem`, that allows you to retrieve a specific optimization problem function by providing its name as a string: @@ -65,12 +65,11 @@ from fireflyalgorithm.problems import get_problem rosenbrock = get_problem('rosenbrock') ``` -For more information about the implemented test functions, [click here](Problems.md) +For more information about the implemented test functions, [click here](Problems.md). -### Command line interface +### Command line interface 🖥️ -The package also comes with a simple command line interface which allows you to evaluate the algorithm on several -popular test functions +The package also comes with a simple command line interface which allows you to evaluate the algorithm on several popular test functions. 🔬 ```shell firefly-algorithm -h @@ -100,10 +99,10 @@ options: --seed SEED Seed for the random number generator ``` -**Note:** The CLI script can also run as a python module (python -m niaarm ...) +**Note:** The CLI script can also run as a python module (python -m niaarm ...). -## Reference Papers: +## Reference Papers 📚 I. Fister Jr., X.-S. Yang, I. Fister, J. Brest. [Memetic firefly algorithm for combinatorial optimization](http://www.iztok-jr-fister.eu/static/publications/44.pdf) in Bioinspired Optimization Methods and their Applications (BIOMA 2012), B. Filipic and J.Silc, Eds. Jozef Stefan Institute, Ljubljana, Slovenia, 2012 From 6044bfe78ec0fefa8fdf38cc9ad71cab916c59eb Mon Sep 17 00:00:00 2001 From: Tadej Lahovnik Date: Mon, 4 Dec 2023 10:41:52 +0100 Subject: [PATCH 28/41] doc: Code of conduct --- CODE_OF_CONDUCT.md | 46 ++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 46 insertions(+) create mode 100644 CODE_OF_CONDUCT.md diff --git a/CODE_OF_CONDUCT.md b/CODE_OF_CONDUCT.md new file mode 100644 index 0000000..7e77a3a --- /dev/null +++ b/CODE_OF_CONDUCT.md @@ -0,0 +1,46 @@ +# Contributor Covenant Code of Conduct + +## Our Pledge + +In the interest of fostering an open and welcoming environment, we as contributors and maintainers pledge to making participation in our project and our community a harassment-free experience for everyone, regardless of age, body size, disability, ethnicity, gender identity and expression, level of experience, nationality, personal appearance, race, religion, or sexual identity and orientation. + +## Our Standards + +Examples of behavior that contributes to creating a positive environment include: + +* Using welcoming and inclusive language +* Being respectful of differing viewpoints and experiences +* Gracefully accepting constructive criticism +* Focusing on what is best for the community +* Showing empathy towards other community members + +Examples of unacceptable behavior by participants include: + +* The use of sexualized language or imagery and unwelcome sexual attention or advances +* Trolling, insulting/derogatory comments, and personal or political attacks +* Public or private harassment +* Publishing others' private information, such as a physical or electronic address, without explicit permission +* Other conduct which could reasonably be considered inappropriate in a professional setting + +## Our Responsibilities + +Project maintainers are responsible for clarifying the standards of acceptable behavior and are expected to take appropriate and fair corrective action in response to any instances of unacceptable behavior. + +Project maintainers have the right and responsibility to remove, edit, or reject comments, commits, code, wiki edits, issues, and other contributions that are not aligned to this Code of Conduct, or to ban temporarily or permanently any contributor for other behaviors that they deem inappropriate, threatening, offensive, or harmful. + +## Scope + +This Code of Conduct applies both within project spaces and in public spaces when an individual is representing the project or its community. Examples of representing a project or community include using an official project e-mail address, posting via an official social media account, or acting as an appointed representative at an online or offline event. Representation of a project may be further defined and clarified by project maintainers. + +## Enforcement + +Instances of abusive, harassing, or otherwise unacceptable behavior may be reported by contacting the project team. The project team will review and investigate all complaints, and will respond in a way that it deems appropriate to the circumstances. The project team is obligated to maintain confidentiality with regard to the reporter of an incident. Further details of specific enforcement policies may be posted separately. + +Project maintainers who do not follow or enforce the Code of Conduct in good faith may face temporary or permanent repercussions as determined by other members of the project's leadership. + +## Attribution + +This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4, available at [http://contributor-covenant.org/version/1/4][version] + +[homepage]: http://contributor-covenant.org +[version]: http://contributor-covenant.org/version/1/4/ From 0d8243b5da7c63cb1ec0c87722345306f048499f Mon Sep 17 00:00:00 2001 From: Iztok Fister Jr Date: Mon, 4 Dec 2023 12:57:53 +0100 Subject: [PATCH 29/41] Fix error in CLI note --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index f0208fe..df9880d 100644 --- a/README.md +++ b/README.md @@ -99,7 +99,7 @@ options: --seed SEED Seed for the random number generator ``` -**Note:** The CLI script can also run as a python module (python -m niaarm ...). +**Note:** The CLI script can also run as a python module (python -m fireflyalgorithm ...). ## Reference Papers 📚 From 6deaed1838918ced61c34bcf0ac7bdd75f7c86a1 Mon Sep 17 00:00:00 2001 From: "Iztok Fister Jr." Date: Mon, 4 Dec 2023 13:21:03 +0100 Subject: [PATCH 30/41] Bump version to 0.4.2 --- fireflyalgorithm/__init__.py | 2 +- pyproject.toml | 5 +++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/fireflyalgorithm/__init__.py b/fireflyalgorithm/__init__.py index 35ed0d4..1a8dc9b 100644 --- a/fireflyalgorithm/__init__.py +++ b/fireflyalgorithm/__init__.py @@ -2,4 +2,4 @@ __all__ = ["FireflyAlgorithm"] -__version__ = "0.4.1" +__version__ = "0.4.2" diff --git a/pyproject.toml b/pyproject.toml index 3fdb198..a35c836 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [tool.poetry] name = "fireflyalgorithm" -version = "0.4.1" +version = "0.4.2" description = "Implementation of Firefly Algorithm in Python" authors = ["Iztok Fister Jr. ", "Luka Pečnik ", "Žiga Stupan "] license = "MIT" @@ -9,7 +9,8 @@ homepage = "https://github.com/firefly-cpp/FireflyAlgorithm" repository = "https://github.com/firefly-cpp/FireflyAlgorithm" include = [ - { path="LICENSE", format="sdist" } + { path="LICENSE", format="sdist" }, + { path="Problems.md", format="sdist" } ] [tool.poetry.dependencies] From 022942c23b65e1241d6b7b74eb4645334e6752dc Mon Sep 17 00:00:00 2001 From: "Iztok Fister Jr." Date: Tue, 5 Dec 2023 12:19:26 +0100 Subject: [PATCH 31/41] Update changelog --- CHANGELOG.md | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 2964d4a..ecb6ba2 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,13 @@ # Changelog +## [0.4.2](https://github.com/firefly-cpp/FireflyAlgorithm/tree/0.4.2) (2023-12-04) + +[Full Changelog](https://github.com/firefly-cpp/FireflyAlgorithm/compare/0.4.1...0.4.2) + +**Merged pull requests:** + +- Contribution guide [\#20](https://github.com/firefly-cpp/FireflyAlgorithm/pull/20) ([lahovniktadej](https://github.com/lahovniktadej)) + ## [0.4.1](https://github.com/firefly-cpp/FireflyAlgorithm/tree/0.4.1) (2023-11-10) [Full Changelog](https://github.com/firefly-cpp/FireflyAlgorithm/compare/0.4.0...0.4.1) From cf24a8a1e8541b8ac05215cb06cfc7247bd55293 Mon Sep 17 00:00:00 2001 From: Iztok Fister Jr Date: Thu, 21 Dec 2023 17:54:27 +0100 Subject: [PATCH 32/41] in repositories badge --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index df9880d..34928c9 100644 --- a/README.md +++ b/README.md @@ -18,6 +18,7 @@ [![Average time to resolve an issue](http://isitmaintained.com/badge/resolution/firefly-cpp/FireflyAlgorithm.svg)](http://isitmaintained.com/project/firefly-cpp/FireflyAlgorithm "Average time to resolve an issue") [![Percentage of issues still open](http://isitmaintained.com/badge/open/firefly-cpp/FireflyAlgorithm.svg)](http://isitmaintained.com/project/firefly-cpp/FireflyAlgorithm "Percentage of issues still open") ![GitHub contributors](https://img.shields.io/github/contributors/firefly-cpp/FireflyAlgorithm.svg) +[![Packaging status](https://repology.org/badge/tiny-repos/python:fireflyalgorithm.svg)](https://repology.org/project/python:fireflyalgorithm/versions) ## About 📋 From 65dd6c078d713dc95449c985809c30ab4e3a3504 Mon Sep 17 00:00:00 2001 From: Iztok Fister Jr Date: Mon, 25 Dec 2023 16:38:47 +0100 Subject: [PATCH 33/41] Badge for Zenodo DOI --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index 34928c9..f8cb55e 100644 --- a/README.md +++ b/README.md @@ -19,6 +19,7 @@ [![Percentage of issues still open](http://isitmaintained.com/badge/open/firefly-cpp/FireflyAlgorithm.svg)](http://isitmaintained.com/project/firefly-cpp/FireflyAlgorithm "Percentage of issues still open") ![GitHub contributors](https://img.shields.io/github/contributors/firefly-cpp/FireflyAlgorithm.svg) [![Packaging status](https://repology.org/badge/tiny-repos/python:fireflyalgorithm.svg)](https://repology.org/project/python:fireflyalgorithm/versions) +[![DOI](https://zenodo.org/badge/DOI/10.5281/zenodo.10430919.svg)](https://doi.org/10.5281/zenodo.10430919) ## About 📋 From fdfb6fac3895ba7466bceca7166ef1f39ce94a25 Mon Sep 17 00:00:00 2001 From: "Iztok Fister Jr." Date: Mon, 25 Dec 2023 16:42:31 +0100 Subject: [PATCH 34/41] Add CITATION.cff and bump version --- CITATION.cff | 21 +++++++++++++++++++++ fireflyalgorithm/__init__.py | 2 +- pyproject.toml | 2 +- 3 files changed, 23 insertions(+), 2 deletions(-) create mode 100644 CITATION.cff diff --git a/CITATION.cff b/CITATION.cff new file mode 100644 index 0000000..9737ab3 --- /dev/null +++ b/CITATION.cff @@ -0,0 +1,21 @@ +abstract: Implementation of Firefly Algorithm in Python +authors: +- family-names: Fister Jr. + given-names: Iztok + orcid: 0000-0002-6418-1272 +- affiliation: '@poviolabs' + family-names: "Pe\u010Dnik" + given-names: Luka + orcid: 0000-0002-3897-9774 +- family-names: Stupan + given-names: "\u017Diga" + orcid: 0000-0001-9847-7306 +cff-version: 1.2.0 +date-released: '2023-12-25' +doi: 10.5281/zenodo.10430919 +license: +- MIT +repository-code: https://github.com/firefly-cpp/FireflyAlgorithm/tree/0.4.4 +title: 'firefly-cpp/FireflyAlgorithm: 0.4.4' +type: software +version: 0.4.4 diff --git a/fireflyalgorithm/__init__.py b/fireflyalgorithm/__init__.py index 1a8dc9b..52d052d 100644 --- a/fireflyalgorithm/__init__.py +++ b/fireflyalgorithm/__init__.py @@ -2,4 +2,4 @@ __all__ = ["FireflyAlgorithm"] -__version__ = "0.4.2" +__version__ = "0.4.4" diff --git a/pyproject.toml b/pyproject.toml index a35c836..b265e6b 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [tool.poetry] name = "fireflyalgorithm" -version = "0.4.2" +version = "0.4.4" description = "Implementation of Firefly Algorithm in Python" authors = ["Iztok Fister Jr. ", "Luka Pečnik ", "Žiga Stupan "] license = "MIT" From e4976c0f12db7d184e71d2faec711b56c5e7e111 Mon Sep 17 00:00:00 2001 From: Iztok Fister Jr Date: Sun, 31 Dec 2023 22:57:23 +0100 Subject: [PATCH 35/41] Repo size badge --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index f8cb55e..1d1a69a 100644 --- a/README.md +++ b/README.md @@ -12,6 +12,7 @@ ![PyPI - Python Version](https://img.shields.io/pypi/pyversions/fireflyalgorithm.svg) ![PyPI - Downloads](https://img.shields.io/pypi/dm/fireflyalgorithm.svg) [![Downloads](https://pepy.tech/badge/fireflyalgorithm)](https://pepy.tech/project/fireflyalgorithm) +![GitHub repo size](https://img.shields.io/github/repo-size/firefly-cpp/FireflyAlgorithm?style=flat-square) [![AUR package](https://img.shields.io/aur/version/python-fireflyalgorithm?color=blue&label=Arch%20Linux&logo=arch-linux)](https://aur.archlinux.org/packages/python-fireflyalgorithm) [![GitHub license](https://img.shields.io/github/license/firefly-cpp/FireflyAlgorithm.svg)](https://github.com/firefly-cpp/FireflyAlgorithm/blob/master/LICENSE) ![GitHub commit activity](https://img.shields.io/github/commit-activity/w/firefly-cpp/FireflyAlgorithm.svg) From ea450bb043951f488b3575872f1df51edbbfb8e7 Mon Sep 17 00:00:00 2001 From: Iztok Fister Jr Date: Thu, 4 Jan 2024 21:03:33 +0100 Subject: [PATCH 36/41] Add citation details in README --- README.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/README.md b/README.md index 1d1a69a..8c4a8c6 100644 --- a/README.md +++ b/README.md @@ -112,6 +112,10 @@ Jozef Stefan Institute, Ljubljana, Slovenia, 2012 I. Fister, I. Fister Jr., X.-S. Yang, J. Brest. [A comprehensive review of firefly algorithms](http://www.iztok-jr-fister.eu/static/publications/23.pdf). Swarm and Evolutionary Computation 13 (2013): 34-46. +## Cite us + +Fister Jr., I., Pečnik, L., & Stupan, Ž. (2023). firefly-cpp/FireflyAlgorithm: 0.4.3 (0.4.3). Zenodo. [https://doi.org/10.5281/zenodo.10430919](https://doi.org/10.5281/zenodo.10430919) + ## License This package is distributed under the MIT License. This license can be found online at . From 79fca912def012796fea86e38bdee0cec95a11be Mon Sep 17 00:00:00 2001 From: Iztok Fister Jr Date: Tue, 6 Feb 2024 19:22:13 +0100 Subject: [PATCH 37/41] Add keywords in pyproject --- pyproject.toml | 1 + 1 file changed, 1 insertion(+) diff --git a/pyproject.toml b/pyproject.toml index b265e6b..01cd204 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -3,6 +3,7 @@ name = "fireflyalgorithm" version = "0.4.4" description = "Implementation of Firefly Algorithm in Python" authors = ["Iztok Fister Jr. ", "Luka Pečnik ", "Žiga Stupan "] +keywords = ['computational intelligence', 'firefly algorithm', 'swarm intelligence', 'optimization'] license = "MIT" readme = "README.md" homepage = "https://github.com/firefly-cpp/FireflyAlgorithm" From 1aa98df0246ee75d39abd92be7f54c3000dbce92 Mon Sep 17 00:00:00 2001 From: Tadej Lahovnik Date: Mon, 22 Jul 2024 09:39:20 +0200 Subject: [PATCH 38/41] doc: README Table of contents --- README.md | 63 ++++++++++++++++++++++++++++++++++--------------------- 1 file changed, 39 insertions(+), 24 deletions(-) diff --git a/README.md b/README.md index 8c4a8c6..527a1b2 100644 --- a/README.md +++ b/README.md @@ -2,33 +2,48 @@

---- +

+Firefly Algorithm --- Implementation of Firefly algorithm in Python +

-# Firefly Algorithm --- Implementation of Firefly algorithm in Python +

+ PyPI Version + PyPI - Python Version + Downloads + GitHub repo size + AUR package + GitHub license + build +

---- +

+ GitHub commit activity + Average time to resolve an issue + Percentage of issues still open + GitHub contributors + Packaging status +

-[![PyPI Version](https://img.shields.io/pypi/v/fireflyalgorithm.svg)](https://pypi.python.org/pypi/fireflyalgorithm) -![PyPI - Python Version](https://img.shields.io/pypi/pyversions/fireflyalgorithm.svg) -![PyPI - Downloads](https://img.shields.io/pypi/dm/fireflyalgorithm.svg) -[![Downloads](https://pepy.tech/badge/fireflyalgorithm)](https://pepy.tech/project/fireflyalgorithm) -![GitHub repo size](https://img.shields.io/github/repo-size/firefly-cpp/FireflyAlgorithm?style=flat-square) -[![AUR package](https://img.shields.io/aur/version/python-fireflyalgorithm?color=blue&label=Arch%20Linux&logo=arch-linux)](https://aur.archlinux.org/packages/python-fireflyalgorithm) -[![GitHub license](https://img.shields.io/github/license/firefly-cpp/FireflyAlgorithm.svg)](https://github.com/firefly-cpp/FireflyAlgorithm/blob/master/LICENSE) -![GitHub commit activity](https://img.shields.io/github/commit-activity/w/firefly-cpp/FireflyAlgorithm.svg) -[![Average time to resolve an issue](http://isitmaintained.com/badge/resolution/firefly-cpp/FireflyAlgorithm.svg)](http://isitmaintained.com/project/firefly-cpp/FireflyAlgorithm "Average time to resolve an issue") -[![Percentage of issues still open](http://isitmaintained.com/badge/open/firefly-cpp/FireflyAlgorithm.svg)](http://isitmaintained.com/project/firefly-cpp/FireflyAlgorithm "Percentage of issues still open") -![GitHub contributors](https://img.shields.io/github/contributors/firefly-cpp/FireflyAlgorithm.svg) -[![Packaging status](https://repology.org/badge/tiny-repos/python:fireflyalgorithm.svg)](https://repology.org/project/python:fireflyalgorithm/versions) -[![DOI](https://zenodo.org/badge/DOI/10.5281/zenodo.10430919.svg)](https://doi.org/10.5281/zenodo.10430919) +

+ DOI +

+ +

+ 📋 About • + 📦 Installation • + 🚀 Usage • + 📚 Reference Papers • + 📄 Cite us • + 🔑 License +

-## About 📋 +## 📋 About This package implements a nature-inspired algorithm for optimization called Firefly Algorithm (FA) in Python programming language. 🌿🔍💻 -## Installation 📦 +## 📦 Installation -Install FireflyAlgorithm with pip: +To install FireflyAlgorithm with pip, use: ```sh pip install fireflyalgorithm ``` @@ -40,12 +55,12 @@ To install FireflyAlgorithm on Arch Linux, please use an [AUR helper](https://wi ```sh $ yay -Syyu python-fireflyalgorithm ``` -To install FireflyAlgorithm on Alpine Linux: +To install FireflyAlgorithm on Alpine Linux, use: ```sh $ apk add py3-fireflyalgorithm ``` -## Usage 🚀 +## 🚀 Usage ```python from fireflyalgorithm import FireflyAlgorithm @@ -105,18 +120,18 @@ options: **Note:** The CLI script can also run as a python module (python -m fireflyalgorithm ...). -## Reference Papers 📚 +## 📚 Reference Papers I. Fister Jr., X.-S. Yang, I. Fister, J. Brest. [Memetic firefly algorithm for combinatorial optimization](http://www.iztok-jr-fister.eu/static/publications/44.pdf) in Bioinspired Optimization Methods and their Applications (BIOMA 2012), B. Filipic and J.Silc, Eds. Jozef Stefan Institute, Ljubljana, Slovenia, 2012 I. Fister, I. Fister Jr., X.-S. Yang, J. Brest. [A comprehensive review of firefly algorithms](http://www.iztok-jr-fister.eu/static/publications/23.pdf). Swarm and Evolutionary Computation 13 (2013): 34-46. -## Cite us +## 📄 Cite us Fister Jr., I., Pečnik, L., & Stupan, Ž. (2023). firefly-cpp/FireflyAlgorithm: 0.4.3 (0.4.3). Zenodo. [https://doi.org/10.5281/zenodo.10430919](https://doi.org/10.5281/zenodo.10430919) -## License +## 🔑 License This package is distributed under the MIT License. This license can be found online at . From d600ff884bf7fb98f0b1ad85242e58d41e7d5505 Mon Sep 17 00:00:00 2001 From: "Iztok Fister Jr." Date: Thu, 25 Jul 2024 12:12:10 +0200 Subject: [PATCH 39/41] Update references --- README.md | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 527a1b2..b0a5485 100644 --- a/README.md +++ b/README.md @@ -122,10 +122,12 @@ options: ## 📚 Reference Papers -I. Fister Jr., X.-S. Yang, I. Fister, J. Brest. [Memetic firefly algorithm for combinatorial optimization](http://www.iztok-jr-fister.eu/static/publications/44.pdf) in Bioinspired Optimization Methods and their Applications (BIOMA 2012), B. Filipic and J.Silc, Eds. +I. Fister Jr., X.-S. Yang, I. Fister, J. Brest, D. Fister. [A Brief Review of Nature-Inspired Algorithms for Optimization](http://www.iztok-jr-fister.eu/static/publications/21.pdf). Elektrotehniški vestnik, 80(3), 116-122, 2013. + +I. Fister Jr., X.-S. Yang, I. Fister, J. Brest. [Memetic firefly algorithm for combinatorial optimization](http://www.iztok-jr-fister.eu/static/publications/44.pdf) in Bioinspired Optimization Methods and their Applications (BIOMA 2012), B. Filipic and J.Silc, Eds. Jozef Stefan Institute, Ljubljana, Slovenia, 2012 -I. Fister, I. Fister Jr., X.-S. Yang, J. Brest. [A comprehensive review of firefly algorithms](http://www.iztok-jr-fister.eu/static/publications/23.pdf). Swarm and Evolutionary Computation 13 (2013): 34-46. +I. Fister, I. Fister Jr., X.-S. Yang, J. Brest. [A comprehensive review of firefly algorithms](http://www.iztok-jr-fister.eu/static/publications/23.pdf). Swarm and Evolutionary Computation 13 (2013): 34-46. ## 📄 Cite us From b489f3515dd20b962219e700cf2f0421a0262f30 Mon Sep 17 00:00:00 2001 From: "Iztok Fister Jr." Date: Thu, 8 Aug 2024 14:00:49 +0200 Subject: [PATCH 40/41] Bump version and rebuilt --- fireflyalgorithm/__init__.py | 2 +- pyproject.toml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/fireflyalgorithm/__init__.py b/fireflyalgorithm/__init__.py index 52d052d..31626e8 100644 --- a/fireflyalgorithm/__init__.py +++ b/fireflyalgorithm/__init__.py @@ -2,4 +2,4 @@ __all__ = ["FireflyAlgorithm"] -__version__ = "0.4.4" +__version__ = "0.4.5" diff --git a/pyproject.toml b/pyproject.toml index 01cd204..4681382 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [tool.poetry] name = "fireflyalgorithm" -version = "0.4.4" +version = "0.4.5" description = "Implementation of Firefly Algorithm in Python" authors = ["Iztok Fister Jr. ", "Luka Pečnik ", "Žiga Stupan "] keywords = ['computational intelligence', 'firefly algorithm', 'swarm intelligence', 'optimization'] From 121b1852a5ae3951034aa49e119d0fd44f1525f9 Mon Sep 17 00:00:00 2001 From: "Iztok Fister Jr." Date: Sat, 4 Jan 2025 20:05:26 +0100 Subject: [PATCH 41/41] Fix dependencies, bump version and rebuilt --- fireflyalgorithm/__init__.py | 2 +- poetry.lock | 142 ++++++++++++++++++++++------------- pyproject.toml | 4 +- 3 files changed, 91 insertions(+), 57 deletions(-) diff --git a/fireflyalgorithm/__init__.py b/fireflyalgorithm/__init__.py index 31626e8..feb6d54 100644 --- a/fireflyalgorithm/__init__.py +++ b/fireflyalgorithm/__init__.py @@ -2,4 +2,4 @@ __all__ = ["FireflyAlgorithm"] -__version__ = "0.4.5" +__version__ = "0.4.6" diff --git a/poetry.lock b/poetry.lock index 0bf4182..3c04aca 100644 --- a/poetry.lock +++ b/poetry.lock @@ -1,4 +1,4 @@ -# This file is automatically @generated by Poetry 1.7.0 and should not be changed by hand. +# This file is automatically @generated by Poetry 1.8.3 and should not be changed by hand. [[package]] name = "colorama" @@ -13,13 +13,13 @@ files = [ [[package]] name = "exceptiongroup" -version = "1.1.3" +version = "1.2.2" description = "Backport of PEP 654 (exception groups)" optional = false python-versions = ">=3.7" files = [ - {file = "exceptiongroup-1.1.3-py3-none-any.whl", hash = "sha256:343280667a4585d195ca1cf9cef84a4e178c4b6cf2274caef9859782b567d5e3"}, - {file = "exceptiongroup-1.1.3.tar.gz", hash = "sha256:097acd85d473d75af5bb98e41b61ff7fe35efe6675e4f9370ec6ec5126d160e9"}, + {file = "exceptiongroup-1.2.2-py3-none-any.whl", hash = "sha256:3111b9d131c238bec2f8f516e123e14ba243563fb135d3fe885990585aa7795b"}, + {file = "exceptiongroup-1.2.2.tar.gz", hash = "sha256:47c2edf7c6738fafb49fd34290706d1a1a2f4d1c6df275526b62cbb4aa5393cc"}, ] [package.extras] @@ -38,65 +38,69 @@ files = [ [[package]] name = "numpy" -version = "1.26.1" +version = "1.26.4" description = "Fundamental package for array computing in Python" optional = false -python-versions = "<3.13,>=3.9" +python-versions = ">=3.9" files = [ - {file = "numpy-1.26.1-cp310-cp310-macosx_10_9_x86_64.whl", hash = "sha256:82e871307a6331b5f09efda3c22e03c095d957f04bf6bc1804f30048d0e5e7af"}, - {file = "numpy-1.26.1-cp310-cp310-macosx_11_0_arm64.whl", hash = "sha256:cdd9ec98f0063d93baeb01aad472a1a0840dee302842a2746a7a8e92968f9575"}, - {file = "numpy-1.26.1-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:d78f269e0c4fd365fc2992c00353e4530d274ba68f15e968d8bc3c69ce5f5244"}, - {file = "numpy-1.26.1-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:8ab9163ca8aeb7fd32fe93866490654d2f7dda4e61bc6297bf72ce07fdc02f67"}, - {file = "numpy-1.26.1-cp310-cp310-musllinux_1_1_x86_64.whl", hash = "sha256:78ca54b2f9daffa5f323f34cdf21e1d9779a54073f0018a3094ab907938331a2"}, - {file = "numpy-1.26.1-cp310-cp310-win32.whl", hash = "sha256:d1cfc92db6af1fd37a7bb58e55c8383b4aa1ba23d012bdbba26b4bcca45ac297"}, - {file = "numpy-1.26.1-cp310-cp310-win_amd64.whl", hash = "sha256:d2984cb6caaf05294b8466966627e80bf6c7afd273279077679cb010acb0e5ab"}, - {file = "numpy-1.26.1-cp311-cp311-macosx_10_9_x86_64.whl", hash = "sha256:cd7837b2b734ca72959a1caf3309457a318c934abef7a43a14bb984e574bbb9a"}, - {file = "numpy-1.26.1-cp311-cp311-macosx_11_0_arm64.whl", hash = "sha256:1c59c046c31a43310ad0199d6299e59f57a289e22f0f36951ced1c9eac3665b9"}, - {file = "numpy-1.26.1-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:d58e8c51a7cf43090d124d5073bc29ab2755822181fcad978b12e144e5e5a4b3"}, - {file = "numpy-1.26.1-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:6081aed64714a18c72b168a9276095ef9155dd7888b9e74b5987808f0dd0a974"}, - {file = "numpy-1.26.1-cp311-cp311-musllinux_1_1_x86_64.whl", hash = "sha256:97e5d6a9f0702c2863aaabf19f0d1b6c2628fbe476438ce0b5ce06e83085064c"}, - {file = "numpy-1.26.1-cp311-cp311-win32.whl", hash = "sha256:b9d45d1dbb9de84894cc50efece5b09939752a2d75aab3a8b0cef6f3a35ecd6b"}, - {file = "numpy-1.26.1-cp311-cp311-win_amd64.whl", hash = "sha256:3649d566e2fc067597125428db15d60eb42a4e0897fc48d28cb75dc2e0454e53"}, - {file = "numpy-1.26.1-cp312-cp312-macosx_10_9_x86_64.whl", hash = "sha256:1d1bd82d539607951cac963388534da3b7ea0e18b149a53cf883d8f699178c0f"}, - {file = "numpy-1.26.1-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:afd5ced4e5a96dac6725daeb5242a35494243f2239244fad10a90ce58b071d24"}, - {file = "numpy-1.26.1-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:a03fb25610ef560a6201ff06df4f8105292ba56e7cdd196ea350d123fc32e24e"}, - {file = "numpy-1.26.1-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:dcfaf015b79d1f9f9c9fd0731a907407dc3e45769262d657d754c3a028586124"}, - {file = "numpy-1.26.1-cp312-cp312-musllinux_1_1_x86_64.whl", hash = "sha256:e509cbc488c735b43b5ffea175235cec24bbc57b227ef1acc691725beb230d1c"}, - {file = "numpy-1.26.1-cp312-cp312-win32.whl", hash = "sha256:af22f3d8e228d84d1c0c44c1fbdeb80f97a15a0abe4f080960393a00db733b66"}, - {file = "numpy-1.26.1-cp312-cp312-win_amd64.whl", hash = "sha256:9f42284ebf91bdf32fafac29d29d4c07e5e9d1af862ea73686581773ef9e73a7"}, - {file = "numpy-1.26.1-cp39-cp39-macosx_10_9_x86_64.whl", hash = "sha256:bb894accfd16b867d8643fc2ba6c8617c78ba2828051e9a69511644ce86ce83e"}, - {file = "numpy-1.26.1-cp39-cp39-macosx_11_0_arm64.whl", hash = "sha256:e44ccb93f30c75dfc0c3aa3ce38f33486a75ec9abadabd4e59f114994a9c4617"}, - {file = "numpy-1.26.1-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:9696aa2e35cc41e398a6d42d147cf326f8f9d81befcb399bc1ed7ffea339b64e"}, - {file = "numpy-1.26.1-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:a5b411040beead47a228bde3b2241100454a6abde9df139ed087bd73fc0a4908"}, - {file = "numpy-1.26.1-cp39-cp39-musllinux_1_1_x86_64.whl", hash = "sha256:1e11668d6f756ca5ef534b5be8653d16c5352cbb210a5c2a79ff288e937010d5"}, - {file = "numpy-1.26.1-cp39-cp39-win32.whl", hash = "sha256:d1d2c6b7dd618c41e202c59c1413ef9b2c8e8a15f5039e344af64195459e3104"}, - {file = "numpy-1.26.1-cp39-cp39-win_amd64.whl", hash = "sha256:59227c981d43425ca5e5c01094d59eb14e8772ce6975d4b2fc1e106a833d5ae2"}, - {file = "numpy-1.26.1-pp39-pypy39_pp73-macosx_10_9_x86_64.whl", hash = "sha256:06934e1a22c54636a059215d6da99e23286424f316fddd979f5071093b648668"}, - {file = "numpy-1.26.1-pp39-pypy39_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:76ff661a867d9272cd2a99eed002470f46dbe0943a5ffd140f49be84f68ffc42"}, - {file = "numpy-1.26.1-pp39-pypy39_pp73-win_amd64.whl", hash = "sha256:6965888d65d2848e8768824ca8288db0a81263c1efccec881cb35a0d805fcd2f"}, - {file = "numpy-1.26.1.tar.gz", hash = "sha256:c8c6c72d4a9f831f328efb1312642a1cafafaa88981d9ab76368d50d07d93cbe"}, + {file = "numpy-1.26.4-cp310-cp310-macosx_10_9_x86_64.whl", hash = "sha256:9ff0f4f29c51e2803569d7a51c2304de5554655a60c5d776e35b4a41413830d0"}, + {file = "numpy-1.26.4-cp310-cp310-macosx_11_0_arm64.whl", hash = "sha256:2e4ee3380d6de9c9ec04745830fd9e2eccb3e6cf790d39d7b98ffd19b0dd754a"}, + {file = "numpy-1.26.4-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:d209d8969599b27ad20994c8e41936ee0964e6da07478d6c35016bc386b66ad4"}, + {file = "numpy-1.26.4-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:ffa75af20b44f8dba823498024771d5ac50620e6915abac414251bd971b4529f"}, + {file = "numpy-1.26.4-cp310-cp310-musllinux_1_1_aarch64.whl", hash = "sha256:62b8e4b1e28009ef2846b4c7852046736bab361f7aeadeb6a5b89ebec3c7055a"}, + {file = "numpy-1.26.4-cp310-cp310-musllinux_1_1_x86_64.whl", hash = "sha256:a4abb4f9001ad2858e7ac189089c42178fcce737e4169dc61321660f1a96c7d2"}, + {file = "numpy-1.26.4-cp310-cp310-win32.whl", hash = "sha256:bfe25acf8b437eb2a8b2d49d443800a5f18508cd811fea3181723922a8a82b07"}, + {file = "numpy-1.26.4-cp310-cp310-win_amd64.whl", hash = "sha256:b97fe8060236edf3662adfc2c633f56a08ae30560c56310562cb4f95500022d5"}, + {file = "numpy-1.26.4-cp311-cp311-macosx_10_9_x86_64.whl", hash = "sha256:4c66707fabe114439db9068ee468c26bbdf909cac0fb58686a42a24de1760c71"}, + {file = "numpy-1.26.4-cp311-cp311-macosx_11_0_arm64.whl", hash = "sha256:edd8b5fe47dab091176d21bb6de568acdd906d1887a4584a15a9a96a1dca06ef"}, + {file = "numpy-1.26.4-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:7ab55401287bfec946ced39700c053796e7cc0e3acbef09993a9ad2adba6ca6e"}, + {file = "numpy-1.26.4-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:666dbfb6ec68962c033a450943ded891bed2d54e6755e35e5835d63f4f6931d5"}, + {file = "numpy-1.26.4-cp311-cp311-musllinux_1_1_aarch64.whl", hash = "sha256:96ff0b2ad353d8f990b63294c8986f1ec3cb19d749234014f4e7eb0112ceba5a"}, + {file = "numpy-1.26.4-cp311-cp311-musllinux_1_1_x86_64.whl", hash = "sha256:60dedbb91afcbfdc9bc0b1f3f402804070deed7392c23eb7a7f07fa857868e8a"}, + {file = "numpy-1.26.4-cp311-cp311-win32.whl", hash = "sha256:1af303d6b2210eb850fcf03064d364652b7120803a0b872f5211f5234b399f20"}, + {file = "numpy-1.26.4-cp311-cp311-win_amd64.whl", hash = "sha256:cd25bcecc4974d09257ffcd1f098ee778f7834c3ad767fe5db785be9a4aa9cb2"}, + {file = "numpy-1.26.4-cp312-cp312-macosx_10_9_x86_64.whl", hash = "sha256:b3ce300f3644fb06443ee2222c2201dd3a89ea6040541412b8fa189341847218"}, + {file = "numpy-1.26.4-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:03a8c78d01d9781b28a6989f6fa1bb2c4f2d51201cf99d3dd875df6fbd96b23b"}, + {file = "numpy-1.26.4-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:9fad7dcb1aac3c7f0584a5a8133e3a43eeb2fe127f47e3632d43d677c66c102b"}, + {file = "numpy-1.26.4-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:675d61ffbfa78604709862923189bad94014bef562cc35cf61d3a07bba02a7ed"}, + {file = "numpy-1.26.4-cp312-cp312-musllinux_1_1_aarch64.whl", hash = "sha256:ab47dbe5cc8210f55aa58e4805fe224dac469cde56b9f731a4c098b91917159a"}, + {file = "numpy-1.26.4-cp312-cp312-musllinux_1_1_x86_64.whl", hash = "sha256:1dda2e7b4ec9dd512f84935c5f126c8bd8b9f2fc001e9f54af255e8c5f16b0e0"}, + {file = "numpy-1.26.4-cp312-cp312-win32.whl", hash = "sha256:50193e430acfc1346175fcbdaa28ffec49947a06918b7b92130744e81e640110"}, + {file = "numpy-1.26.4-cp312-cp312-win_amd64.whl", hash = "sha256:08beddf13648eb95f8d867350f6a018a4be2e5ad54c8d8caed89ebca558b2818"}, + {file = "numpy-1.26.4-cp39-cp39-macosx_10_9_x86_64.whl", hash = "sha256:7349ab0fa0c429c82442a27a9673fc802ffdb7c7775fad780226cb234965e53c"}, + {file = "numpy-1.26.4-cp39-cp39-macosx_11_0_arm64.whl", hash = "sha256:52b8b60467cd7dd1e9ed082188b4e6bb35aa5cdd01777621a1658910745b90be"}, + {file = "numpy-1.26.4-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:d5241e0a80d808d70546c697135da2c613f30e28251ff8307eb72ba696945764"}, + {file = "numpy-1.26.4-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:f870204a840a60da0b12273ef34f7051e98c3b5961b61b0c2c1be6dfd64fbcd3"}, + {file = "numpy-1.26.4-cp39-cp39-musllinux_1_1_aarch64.whl", hash = "sha256:679b0076f67ecc0138fd2ede3a8fd196dddc2ad3254069bcb9faf9a79b1cebcd"}, + {file = "numpy-1.26.4-cp39-cp39-musllinux_1_1_x86_64.whl", hash = "sha256:47711010ad8555514b434df65f7d7b076bb8261df1ca9bb78f53d3b2db02e95c"}, + {file = "numpy-1.26.4-cp39-cp39-win32.whl", hash = "sha256:a354325ee03388678242a4d7ebcd08b5c727033fcff3b2f536aea978e15ee9e6"}, + {file = "numpy-1.26.4-cp39-cp39-win_amd64.whl", hash = "sha256:3373d5d70a5fe74a2c1bb6d2cfd9609ecf686d47a2d7b1d37a8f3b6bf6003aea"}, + {file = "numpy-1.26.4-pp39-pypy39_pp73-macosx_10_9_x86_64.whl", hash = "sha256:afedb719a9dcfc7eaf2287b839d8198e06dcd4cb5d276a3df279231138e83d30"}, + {file = "numpy-1.26.4-pp39-pypy39_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:95a7476c59002f2f6c590b9b7b998306fba6a5aa646b1e22ddfeaf8f78c3a29c"}, + {file = "numpy-1.26.4-pp39-pypy39_pp73-win_amd64.whl", hash = "sha256:7e50d0a0cc3189f9cb0aeb3a6a6af18c16f59f004b866cd2be1c14b36134a4a0"}, + {file = "numpy-1.26.4.tar.gz", hash = "sha256:2a02aba9ed12e4ac4eb3ea9421c420301a0c6460d9830d74a9df87efa4912010"}, ] [[package]] name = "packaging" -version = "23.2" +version = "24.2" description = "Core utilities for Python packages" optional = false -python-versions = ">=3.7" +python-versions = ">=3.8" files = [ - {file = "packaging-23.2-py3-none-any.whl", hash = "sha256:8c491190033a9af7e1d931d0b5dacc2ef47509b34dd0de67ed209b5203fc88c7"}, - {file = "packaging-23.2.tar.gz", hash = "sha256:048fb0e9405036518eaaf48a55953c750c11e1a1b68e0dd1a9d62ed0c092cfc5"}, + {file = "packaging-24.2-py3-none-any.whl", hash = "sha256:09abb1bccd265c01f4a3aa3f7a7db064b36514d2cba19a2f694fe6150451a759"}, + {file = "packaging-24.2.tar.gz", hash = "sha256:c228a6dc5e932d346bc5739379109d49e8853dd8223571c7c5b55260edc0b97f"}, ] [[package]] name = "pluggy" -version = "1.3.0" +version = "1.5.0" description = "plugin and hook calling mechanisms for python" optional = false python-versions = ">=3.8" files = [ - {file = "pluggy-1.3.0-py3-none-any.whl", hash = "sha256:d89c696a773f8bd377d18e5ecda92b7a3793cbe66c87060a6fb58c7b6e1061f7"}, - {file = "pluggy-1.3.0.tar.gz", hash = "sha256:cf61ae8f126ac6f7c451172cf30e3e43d3ca77615509771b3a984a0730651e12"}, + {file = "pluggy-1.5.0-py3-none-any.whl", hash = "sha256:44e1ad92c8ca002de6377e165f3e0f1be63266ab4d554740532335b9d75ea669"}, + {file = "pluggy-1.5.0.tar.gz", hash = "sha256:2cffa88e94fdc978c4c574f15f9e59b7f4201d439195c3715ca9e2486f1d0cf1"}, ] [package.extras] @@ -105,13 +109,13 @@ testing = ["pytest", "pytest-benchmark"] [[package]] name = "pytest" -version = "7.4.3" +version = "7.4.4" description = "pytest: simple powerful testing with Python" optional = false python-versions = ">=3.7" files = [ - {file = "pytest-7.4.3-py3-none-any.whl", hash = "sha256:0d009c083ea859a71b76adf7c1d502e4bc170b80a8ef002da5806527b9591fac"}, - {file = "pytest-7.4.3.tar.gz", hash = "sha256:d989d136982de4e3b29dabcc838ad581c64e8ed52c11fbe86ddebd9da0818cd5"}, + {file = "pytest-7.4.4-py3-none-any.whl", hash = "sha256:b090cdf5ed60bf4c45261be03239c2c1c22df034fbffe691abe93cd80cea01d8"}, + {file = "pytest-7.4.4.tar.gz", hash = "sha256:2cf0005922c6ace4a3e2ec8b4080eb0d9753fdc93107415332f50ce9e7994280"}, ] [package.dependencies] @@ -127,16 +131,46 @@ testing = ["argcomplete", "attrs (>=19.2.0)", "hypothesis (>=3.56)", "mock", "no [[package]] name = "tomli" -version = "2.0.1" +version = "2.2.1" description = "A lil' TOML parser" optional = false -python-versions = ">=3.7" +python-versions = ">=3.8" files = [ - {file = "tomli-2.0.1-py3-none-any.whl", hash = "sha256:939de3e7a6161af0c887ef91b7d41a53e7c5a1ca976325f429cb46ea9bc30ecc"}, - {file = "tomli-2.0.1.tar.gz", hash = "sha256:de526c12914f0c550d15924c62d72abc48d6fe7364aa87328337a31007fe8a4f"}, + {file = "tomli-2.2.1-cp311-cp311-macosx_10_9_x86_64.whl", hash = "sha256:678e4fa69e4575eb77d103de3df8a895e1591b48e740211bd1067378c69e8249"}, + {file = "tomli-2.2.1-cp311-cp311-macosx_11_0_arm64.whl", hash = "sha256:023aa114dd824ade0100497eb2318602af309e5a55595f76b626d6d9f3b7b0a6"}, + {file = "tomli-2.2.1-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:ece47d672db52ac607a3d9599a9d48dcb2f2f735c6c2d1f34130085bb12b112a"}, + {file = "tomli-2.2.1-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:6972ca9c9cc9f0acaa56a8ca1ff51e7af152a9f87fb64623e31d5c83700080ee"}, + {file = "tomli-2.2.1-cp311-cp311-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:c954d2250168d28797dd4e3ac5cf812a406cd5a92674ee4c8f123c889786aa8e"}, + {file = "tomli-2.2.1-cp311-cp311-musllinux_1_2_aarch64.whl", hash = "sha256:8dd28b3e155b80f4d54beb40a441d366adcfe740969820caf156c019fb5c7ec4"}, + {file = "tomli-2.2.1-cp311-cp311-musllinux_1_2_i686.whl", hash = "sha256:e59e304978767a54663af13c07b3d1af22ddee3bb2fb0618ca1593e4f593a106"}, + {file = "tomli-2.2.1-cp311-cp311-musllinux_1_2_x86_64.whl", hash = "sha256:33580bccab0338d00994d7f16f4c4ec25b776af3ffaac1ed74e0b3fc95e885a8"}, + {file = "tomli-2.2.1-cp311-cp311-win32.whl", hash = "sha256:465af0e0875402f1d226519c9904f37254b3045fc5084697cefb9bdde1ff99ff"}, + {file = "tomli-2.2.1-cp311-cp311-win_amd64.whl", hash = "sha256:2d0f2fdd22b02c6d81637a3c95f8cd77f995846af7414c5c4b8d0545afa1bc4b"}, + {file = "tomli-2.2.1-cp312-cp312-macosx_10_13_x86_64.whl", hash = "sha256:4a8f6e44de52d5e6c657c9fe83b562f5f4256d8ebbfe4ff922c495620a7f6cea"}, + {file = "tomli-2.2.1-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:8d57ca8095a641b8237d5b079147646153d22552f1c637fd3ba7f4b0b29167a8"}, + {file = "tomli-2.2.1-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:4e340144ad7ae1533cb897d406382b4b6fede8890a03738ff1683af800d54192"}, + {file = "tomli-2.2.1-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:db2b95f9de79181805df90bedc5a5ab4c165e6ec3fe99f970d0e302f384ad222"}, + {file = "tomli-2.2.1-cp312-cp312-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:40741994320b232529c802f8bc86da4e1aa9f413db394617b9a256ae0f9a7f77"}, + {file = "tomli-2.2.1-cp312-cp312-musllinux_1_2_aarch64.whl", hash = "sha256:400e720fe168c0f8521520190686ef8ef033fb19fc493da09779e592861b78c6"}, + {file = "tomli-2.2.1-cp312-cp312-musllinux_1_2_i686.whl", hash = "sha256:02abe224de6ae62c19f090f68da4e27b10af2b93213d36cf44e6e1c5abd19fdd"}, + {file = "tomli-2.2.1-cp312-cp312-musllinux_1_2_x86_64.whl", hash = "sha256:b82ebccc8c8a36f2094e969560a1b836758481f3dc360ce9a3277c65f374285e"}, + {file = "tomli-2.2.1-cp312-cp312-win32.whl", hash = "sha256:889f80ef92701b9dbb224e49ec87c645ce5df3fa2cc548664eb8a25e03127a98"}, + {file = "tomli-2.2.1-cp312-cp312-win_amd64.whl", hash = "sha256:7fc04e92e1d624a4a63c76474610238576942d6b8950a2d7f908a340494e67e4"}, + {file = "tomli-2.2.1-cp313-cp313-macosx_10_13_x86_64.whl", hash = "sha256:f4039b9cbc3048b2416cc57ab3bda989a6fcf9b36cf8937f01a6e731b64f80d7"}, + {file = "tomli-2.2.1-cp313-cp313-macosx_11_0_arm64.whl", hash = "sha256:286f0ca2ffeeb5b9bd4fcc8d6c330534323ec51b2f52da063b11c502da16f30c"}, + {file = "tomli-2.2.1-cp313-cp313-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:a92ef1a44547e894e2a17d24e7557a5e85a9e1d0048b0b5e7541f76c5032cb13"}, + {file = "tomli-2.2.1-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:9316dc65bed1684c9a98ee68759ceaed29d229e985297003e494aa825ebb0281"}, + {file = "tomli-2.2.1-cp313-cp313-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:e85e99945e688e32d5a35c1ff38ed0b3f41f43fad8df0bdf79f72b2ba7bc5272"}, + {file = "tomli-2.2.1-cp313-cp313-musllinux_1_2_aarch64.whl", hash = "sha256:ac065718db92ca818f8d6141b5f66369833d4a80a9d74435a268c52bdfa73140"}, + {file = "tomli-2.2.1-cp313-cp313-musllinux_1_2_i686.whl", hash = "sha256:d920f33822747519673ee656a4b6ac33e382eca9d331c87770faa3eef562aeb2"}, + {file = "tomli-2.2.1-cp313-cp313-musllinux_1_2_x86_64.whl", hash = "sha256:a198f10c4d1b1375d7687bc25294306e551bf1abfa4eace6650070a5c1ae2744"}, + {file = "tomli-2.2.1-cp313-cp313-win32.whl", hash = "sha256:d3f5614314d758649ab2ab3a62d4f2004c825922f9e370b29416484086b264ec"}, + {file = "tomli-2.2.1-cp313-cp313-win_amd64.whl", hash = "sha256:a38aa0308e754b0e3c67e344754dff64999ff9b513e691d0e786265c93583c69"}, + {file = "tomli-2.2.1-py3-none-any.whl", hash = "sha256:cb55c73c5f4408779d0cf3eef9f762b9c9f147a77de7b258bef0a5628adc85cc"}, + {file = "tomli-2.2.1.tar.gz", hash = "sha256:cd45e1dc79c835ce60f7404ec8119f2eb06d38b1deba146f07ced3bbc44505ff"}, ] [metadata] lock-version = "2.0" -python-versions = "^3.9,<3.13" -content-hash = "aa27aa586ebf5e13d1936db455cb5da27cc641ae1ffc6434877928a3baa9bb82" +python-versions = "^3.9,<3.14" +content-hash = "3cd4e3325b88b677715a63c130cd79d70a3e3586c0df36c5d40aba429342caa7" diff --git a/pyproject.toml b/pyproject.toml index 4681382..c7346a0 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [tool.poetry] name = "fireflyalgorithm" -version = "0.4.5" +version = "0.4.6" description = "Implementation of Firefly Algorithm in Python" authors = ["Iztok Fister Jr. ", "Luka Pečnik ", "Žiga Stupan "] keywords = ['computational intelligence', 'firefly algorithm', 'swarm intelligence', 'optimization'] @@ -15,7 +15,7 @@ include = [ ] [tool.poetry.dependencies] -python = "^3.9,<3.13" +python = "^3.9,<3.14" numpy = "^1.26.1" [tool.poetry.group.test.dependencies] pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy