Skip to content

Commit

Permalink
Fix doc typos in binary discrete optimizer module (pyswarms.discrete.…
Browse files Browse the repository at this point in the history
…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).
  • Loading branch information
Archer6621 authored Jun 17, 2020
1 parent 9fcfbc6 commit ea9de04
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions pyswarms/discrete/binary.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
.. math::
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)]
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)]
For the velocity update rule, a particle compares its current position
with respect to its neighbours. The nearest neighbours are being
Expand Down Expand Up @@ -87,7 +87,7 @@ def __init__(
number of particles in the swarm.
dimensions : int
number of dimensions in the space.
options : dict with keys :code:`{'c1', 'c2', 'k', 'p'}`
options : dict with keys :code:`{'c1', 'c2', 'w', 'k', 'p'}`
a dictionary containing the parameters for the specific
optimization technique
* c1 : float
Expand Down

0 comments on commit ea9de04

Please sign in to comment.