Skip to content

Commit ea9de04

Browse files
authored
Fix doc typos in binary discrete optimizer module (pyswarms.discrete.binary) (#409)
* Fix typo in formula: 'm' --> 'w' Since 'm' wasn't defined anywhere, I assumed the inertia 'w' was actually meant here, similar to the formula for the real-valued algorithm * Add missing 'w' entry in `options` dict keyword argument in doc for BinaryPSO init The 'w' key was missing in the `options` dictionary, but was described below in the list (and is used in the code as well).
1 parent 9fcfbc6 commit ea9de04

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

pyswarms/discrete/binary.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
1515
.. math::
1616
17-
v_{ij}(t + 1) = m * v_{ij}(t) + c_{1}r_{1j}(t)[y_{ij}(t) − x_{ij}(t)] + c_{2}r_{2j}(t)[\hat{y}_{j}(t) − x_{ij}(t)]
17+
v_{ij}(t + 1) = w * v_{ij}(t) + c_{1}r_{1j}(t)[y_{ij}(t) − x_{ij}(t)] + c_{2}r_{2j}(t)[\hat{y}_{j}(t) − x_{ij}(t)]
1818
1919
For the velocity update rule, a particle compares its current position
2020
with respect to its neighbours. The nearest neighbours are being
@@ -87,7 +87,7 @@ def __init__(
8787
number of particles in the swarm.
8888
dimensions : int
8989
number of dimensions in the space.
90-
options : dict with keys :code:`{'c1', 'c2', 'k', 'p'}`
90+
options : dict with keys :code:`{'c1', 'c2', 'w', 'k', 'p'}`
9191
a dictionary containing the parameters for the specific
9292
optimization technique
9393
* c1 : float

0 commit comments

Comments
 (0)