Skip to content

Commit 783c6a1

Browse files
authored
Merge pull request #3 from zStupan/update-readme
Update README
2 parents c0d70cf + 85c10f5 commit 783c6a1

File tree

2 files changed

+47
-4
lines changed

2 files changed

+47
-4
lines changed

README.md

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,20 @@
11
# Firefly Algorithm in Python
22

3-
## INSTALLATION:
3+
## Installation:
44

55
```sh
66
pip install fireflyalgorithm
77
```
88
To install FireflyAlgorithm on Fedora, use:
99
```sh
10-
$ dnf install python-fireflyalgorithm
10+
dnf install python-fireflyalgorithm
1111
```
1212

13-
## CODE EXAMPLE:
13+
## Usage:
1414

1515
```python
16-
from FireflyAlgorithm import *
16+
import numpy as np
17+
from FireflyAlgorithm import FireflyAlgorithm
1718

1819

1920
def sphere(x):

README.rst

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
Summary
2+
-------
3+
4+
Implementation of the standard Firefly Algorithm in Python.
5+
6+
Installation
7+
------------
8+
9+
.. code:: sh
10+
11+
pip install fireflyalgorithm
12+
13+
14+
To install FireflyAlgorithm on Fedora, use:
15+
16+
.. code:: sh
17+
18+
sudo dnf install python-fireflyalgorithm
19+
20+
Usage
21+
-----
22+
23+
.. code:: python
24+
25+
import numpy as np
26+
from FireflyAlgorithm import FireflyAlgorithm
27+
28+
29+
def sphere(x):
30+
return np.sum(x ** 2)
31+
32+
33+
best = FireflyAlgorithm(function=sphere, dim=10, lb=-5, ub=5, max_evals=10000)
34+
print(best)
35+
36+
Reference papers
37+
----------------
38+
39+
\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
40+
41+
\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.
42+

0 commit comments

Comments
 (0)