summaryrefslogtreecommitdiff
path: root/python-FireflyAlgorithm.spec
blob: 217d4e3aeb388fce2b9be1450381633e40914f84 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
%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
<p align="center">
  <img width="200" src="https://raw.githubusercontent.com/firefly-cpp/FireflyAlgorithm/master/.github/imgs/firefly_logo.png">
</p>

<h1 align="center">
Firefly Algorithm --- Implementation of Firefly algorithm in Python
</h1>

<p align="center">
  <img alt="PyPI Version" src="https://img.shields.io/pypi/v/fireflyalgorithm.svg" href="https://pypi.python.org/pypi/fireflyalgorithm">
  <img alt="PyPI - Python Version" src="https://img.shields.io/pypi/pyversions/fireflyalgorithm.svg">
  <img alt="Downloads" src="https://img.shields.io/pypi/dm/fireflyalgorithm.svg">
  <img alt="GitHub repo size" src="https://img.shields.io/github/repo-size/firefly-cpp/FireflyAlgorithm">
  <img alt="AUR package" src="https://img.shields.io/aur/version/python-fireflyalgorithm?color=blue&label=Arch%20Linux&logo=arch-linux" href="https://aur.archlinux.org/packages/python-fireflyalgorithm">
  <img alt="GitHub license" src="https://img.shields.io/github/license/firefly-cpp/FireflyAlgorithm.svg" href="https://github.com/firefly-cpp/FireflyAlgorithm/blob/master/LICENSE">  
  <img alt="build" src="https://github.com/firefly-cpp/FireflyAlgorithm/actions/workflows/test.yml/badge.svg">
</p>

<p align="center">
  <img alt="GitHub commit activity" src="https://img.shields.io/github/commit-activity/w/firefly-cpp/FireflyAlgorithm.svg">
  <img alt="Average time to resolve an issue" src="http://isitmaintained.com/badge/resolution/firefly-cpp/FireflyAlgorithm.svg" href="http://isitmaintained.com/project/firefly-cpp/FireflyAlgorithm">
  <img alt="Percentage of issues still open" src="http://isitmaintained.com/badge/open/firefly-cpp/FireflyAlgorithm.svg" href="http://isitmaintained.com/project/firefly-cpp/FireflyAlgorithm">
  <img alt="GitHub contributors" src="https://img.shields.io/github/contributors/firefly-cpp/FireflyAlgorithm.svg">
  <img alt="Packaging status" src="https://repology.org/badge/tiny-repos/python:fireflyalgorithm.svg" href="https://repology.org/project/python:fireflyalgorithm/versions">
</p>

<p align="center">
  <img alt="DOI" src="https://zenodo.org/badge/DOI/10.5281/zenodo.10430919.svg" href="https://doi.org/10.5281/zenodo.10430919">
</p>

<p align="center">
  <a href="#-about">πŸ“‹ About</a> β€’
  <a href="#-installation">πŸ“¦ Installation</a> β€’
  <a href="#-usage">πŸš€ Usage</a> β€’
  <a href="#-reference-papers">πŸ“š Reference Papers</a> β€’
  <a href="#-cite-us">πŸ“„ Cite us</a> β€’
  <a href="#-license">πŸ”‘ License</a>
</p>

## πŸ“‹ 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 <http://www.opensource.org/licenses/MIT>.

## Disclaimer

This framework is provided as-is, and there are no guarantees that it fits your purposes or that it is bug-free. Use it at your own risk!


%package -n python3-fireflyalgorithm
Summary:	Implementation of Firefly Algorithm in Python
Provides:	python-fireflyalgorithm
BuildRequires:	python3-devel
BuildRequires:	python3-setuptools
BuildRequires:	python3-pip
BuildRequires:	python3-wheel
%description -n python3-fireflyalgorithm
<p align="center">
  <img width="200" src="https://raw.githubusercontent.com/firefly-cpp/FireflyAlgorithm/master/.github/imgs/firefly_logo.png">
</p>

<h1 align="center">
Firefly Algorithm --- Implementation of Firefly algorithm in Python
</h1>

<p align="center">
  <img alt="PyPI Version" src="https://img.shields.io/pypi/v/fireflyalgorithm.svg" href="https://pypi.python.org/pypi/fireflyalgorithm">
  <img alt="PyPI - Python Version" src="https://img.shields.io/pypi/pyversions/fireflyalgorithm.svg">
  <img alt="Downloads" src="https://img.shields.io/pypi/dm/fireflyalgorithm.svg">
  <img alt="GitHub repo size" src="https://img.shields.io/github/repo-size/firefly-cpp/FireflyAlgorithm">
  <img alt="AUR package" src="https://img.shields.io/aur/version/python-fireflyalgorithm?color=blue&label=Arch%20Linux&logo=arch-linux" href="https://aur.archlinux.org/packages/python-fireflyalgorithm">
  <img alt="GitHub license" src="https://img.shields.io/github/license/firefly-cpp/FireflyAlgorithm.svg" href="https://github.com/firefly-cpp/FireflyAlgorithm/blob/master/LICENSE">  
  <img alt="build" src="https://github.com/firefly-cpp/FireflyAlgorithm/actions/workflows/test.yml/badge.svg">
</p>

<p align="center">
  <img alt="GitHub commit activity" src="https://img.shields.io/github/commit-activity/w/firefly-cpp/FireflyAlgorithm.svg">
  <img alt="Average time to resolve an issue" src="http://isitmaintained.com/badge/resolution/firefly-cpp/FireflyAlgorithm.svg" href="http://isitmaintained.com/project/firefly-cpp/FireflyAlgorithm">
  <img alt="Percentage of issues still open" src="http://isitmaintained.com/badge/open/firefly-cpp/FireflyAlgorithm.svg" href="http://isitmaintained.com/project/firefly-cpp/FireflyAlgorithm">
  <img alt="GitHub contributors" src="https://img.shields.io/github/contributors/firefly-cpp/FireflyAlgorithm.svg">
  <img alt="Packaging status" src="https://repology.org/badge/tiny-repos/python:fireflyalgorithm.svg" href="https://repology.org/project/python:fireflyalgorithm/versions">
</p>

<p align="center">
  <img alt="DOI" src="https://zenodo.org/badge/DOI/10.5281/zenodo.10430919.svg" href="https://doi.org/10.5281/zenodo.10430919">
</p>

<p align="center">
  <a href="#-about">πŸ“‹ About</a> β€’
  <a href="#-installation">πŸ“¦ Installation</a> β€’
  <a href="#-usage">πŸš€ Usage</a> β€’
  <a href="#-reference-papers">πŸ“š Reference Papers</a> β€’
  <a href="#-cite-us">πŸ“„ Cite us</a> β€’
  <a href="#-license">πŸ”‘ License</a>
</p>

## πŸ“‹ 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 <http://www.opensource.org/licenses/MIT>.

## Disclaimer

This framework is provided as-is, and there are no guarantees that it fits your purposes or that it is bug-free. Use it at your own risk!


%package help
Summary:	Development documents and examples for fireflyalgorithm
Provides:	python3-fireflyalgorithm-doc
%description help
<p align="center">
  <img width="200" src="https://raw.githubusercontent.com/firefly-cpp/FireflyAlgorithm/master/.github/imgs/firefly_logo.png">
</p>

<h1 align="center">
Firefly Algorithm --- Implementation of Firefly algorithm in Python
</h1>

<p align="center">
  <img alt="PyPI Version" src="https://img.shields.io/pypi/v/fireflyalgorithm.svg" href="https://pypi.python.org/pypi/fireflyalgorithm">
  <img alt="PyPI - Python Version" src="https://img.shields.io/pypi/pyversions/fireflyalgorithm.svg">
  <img alt="Downloads" src="https://img.shields.io/pypi/dm/fireflyalgorithm.svg">
  <img alt="GitHub repo size" src="https://img.shields.io/github/repo-size/firefly-cpp/FireflyAlgorithm">
  <img alt="AUR package" src="https://img.shields.io/aur/version/python-fireflyalgorithm?color=blue&label=Arch%20Linux&logo=arch-linux" href="https://aur.archlinux.org/packages/python-fireflyalgorithm">
  <img alt="GitHub license" src="https://img.shields.io/github/license/firefly-cpp/FireflyAlgorithm.svg" href="https://github.com/firefly-cpp/FireflyAlgorithm/blob/master/LICENSE">  
  <img alt="build" src="https://github.com/firefly-cpp/FireflyAlgorithm/actions/workflows/test.yml/badge.svg">
</p>

<p align="center">
  <img alt="GitHub commit activity" src="https://img.shields.io/github/commit-activity/w/firefly-cpp/FireflyAlgorithm.svg">
  <img alt="Average time to resolve an issue" src="http://isitmaintained.com/badge/resolution/firefly-cpp/FireflyAlgorithm.svg" href="http://isitmaintained.com/project/firefly-cpp/FireflyAlgorithm">
  <img alt="Percentage of issues still open" src="http://isitmaintained.com/badge/open/firefly-cpp/FireflyAlgorithm.svg" href="http://isitmaintained.com/project/firefly-cpp/FireflyAlgorithm">
  <img alt="GitHub contributors" src="https://img.shields.io/github/contributors/firefly-cpp/FireflyAlgorithm.svg">
  <img alt="Packaging status" src="https://repology.org/badge/tiny-repos/python:fireflyalgorithm.svg" href="https://repology.org/project/python:fireflyalgorithm/versions">
</p>

<p align="center">
  <img alt="DOI" src="https://zenodo.org/badge/DOI/10.5281/zenodo.10430919.svg" href="https://doi.org/10.5281/zenodo.10430919">
</p>

<p align="center">
  <a href="#-about">πŸ“‹ About</a> β€’
  <a href="#-installation">πŸ“¦ Installation</a> β€’
  <a href="#-usage">πŸš€ Usage</a> β€’
  <a href="#-reference-papers">πŸ“š Reference Papers</a> β€’
  <a href="#-cite-us">πŸ“„ Cite us</a> β€’
  <a href="#-license">πŸ”‘ License</a>
</p>

## πŸ“‹ 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 <http://www.opensource.org/licenses/MIT>.

## Disclaimer

This framework is provided as-is, and there are no guarantees that it fits your purposes or that it is bug-free. Use it at your own risk!


%prep
%autosetup -n fireflyalgorithm-0.4.6

%build
%pyproject_build

%install
%pyproject_install
install -d -m755 %{buildroot}/%{_pkgdocdir}
if [ -d doc ]; then cp -arf doc %{buildroot}/%{_pkgdocdir}; fi
if [ -d docs ]; then cp -arf docs %{buildroot}/%{_pkgdocdir}; fi
if [ -d example ]; then cp -arf example %{buildroot}/%{_pkgdocdir}; fi
if [ -d examples ]; then cp -arf examples %{buildroot}/%{_pkgdocdir}; fi
pushd %{buildroot}
touch filelist.lst
if [ -d usr/lib64 ]; then
	find usr/lib64 -type f -printf "\"/%h/%f\"\n" >> filelist.lst
fi
if [ -d usr/bin ]; then
	find usr/bin -type f -printf "\"/%h/%f\"\n" >> filelist.lst
fi
if [ -d usr/sbin ]; then
	find usr/sbin -type f -printf "\"/%h/%f\"\n" >> filelist.lst
fi
touch doclist.lst
if [ -d usr/share/man ]; then
	find usr/share/man -type f -printf "\"/%h/%f.gz\"\n" >> doclist.lst
fi
popd
mv %{buildroot}/filelist.lst .
mv %{buildroot}/doclist.lst .

%files -n python3-fireflyalgorithm -f filelist.lst
%{python3_sitelib}/*

%files help -f doclist.lst
%{_docdir}/*

%changelog
* Sat Aug 16 2025 Python_Bot <Python_Bot@openeuler.org> - 0.4.6-1
- Package Spec generated