%global _empty_manifest_terminate_build 0 Name: python-fireflyalgorithm Version: 0.4.6 Release: 1 Summary: Implementation of Firefly Algorithm in Python License: MIT URL: https://github.com/firefly-cpp/FireflyAlgorithm Source0: https://mirrors.aliyun.com/pypi/web/packages/99/dc/e968e2e2c2a741df2ac8cc5ab66db73c1485ae9c0d00ba4a51b9f64c2163/fireflyalgorithm-0.4.6.tar.gz BuildArch: noarch Requires: (python3-numpy<2.0.0 with python3-numpy>=1.26.1) %description
π About β’ π¦ Installation β’ π Usage β’ π Reference Papers β’ π Cite us β’ π License
## π About This package implements a nature-inspired algorithm for optimization called Firefly Algorithm (FA) in Python programming language. πΏππ» ## π¦ Installation To install FireflyAlgorithm with pip, use: ```sh pip install fireflyalgorithm ``` 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 ``` To install FireflyAlgorithm on Alpine Linux, use: ```sh $ apk add py3-fireflyalgorithm ``` ## π Usage ```python from fireflyalgorithm import FireflyAlgorithm from fireflyalgorithm.problems import sphere FA = FireflyAlgorithm() 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 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 fireflyalgorithm ...). ## π Reference Papers 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. ## π 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
π About β’ π¦ Installation β’ π Usage β’ π Reference Papers β’ π Cite us β’ π License
## π About This package implements a nature-inspired algorithm for optimization called Firefly Algorithm (FA) in Python programming language. πΏππ» ## π¦ Installation To install FireflyAlgorithm with pip, use: ```sh pip install fireflyalgorithm ``` 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 ``` To install FireflyAlgorithm on Alpine Linux, use: ```sh $ apk add py3-fireflyalgorithm ``` ## π Usage ```python from fireflyalgorithm import FireflyAlgorithm from fireflyalgorithm.problems import sphere FA = FireflyAlgorithm() 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 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 fireflyalgorithm ...). ## π Reference Papers 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. ## π 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
π About β’ π¦ Installation β’ π Usage β’ π Reference Papers β’ π Cite us β’ π License
## π About This package implements a nature-inspired algorithm for optimization called Firefly Algorithm (FA) in Python programming language. πΏππ» ## π¦ Installation To install FireflyAlgorithm with pip, use: ```sh pip install fireflyalgorithm ``` 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 ``` To install FireflyAlgorithm on Alpine Linux, use: ```sh $ apk add py3-fireflyalgorithm ``` ## π Usage ```python from fireflyalgorithm import FireflyAlgorithm from fireflyalgorithm.problems import sphere FA = FireflyAlgorithm() 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 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 fireflyalgorithm ...). ## π Reference Papers 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. ## π 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