-
Notifications
You must be signed in to change notification settings - Fork 334
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add BoundaryHandler and VelocityHandler (#238)
Implements the new `BoundaryHandler` and `VelocityHandler` classes that deal with the issue of particles that don't move in optimisations with boundary conditions. This is achieved by using different strategies that have been described in [Hel10](https://opus4.kobv.de/opus4-fau/frontdoor/index/index/year/2010/docId/1328) (P. 28). These strategies include: - Nearest bound: Reset particle to the nearest boundary - Random: Reset the particle to a random position within the bounds - Shrink: Shrink the velocity such that the particle touches the boundary instead of surpassing it - Intermediate: Reset the particle to a value between its former location and the bound - Resample: Calculate new velocities until the next particle position is within the bounds - Periodic: Tile the space with the same search space over and over - Reflective: Mirror the position of the particle at the surpassed boundary Resolves #237
- Loading branch information
1 parent
0adef1a
commit 50f6e15
Showing
21 changed files
with
1,033 additions
and
116 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
pyswarms.handlers package | ||
========================= | ||
|
||
This package implements different handling strategies for the optimiziation | ||
using boundary conditions. The strategies help avoiding that particles | ||
leave the defined search space. There are two :code:`Handler` classes | ||
that provide these functionalities, the :class:`BoundaryHandler` and the | ||
:class:`VelocityHandler`. | ||
|
||
pyswarms.handlers class | ||
----------------------- | ||
|
||
.. automodule:: pyswarms.backend.handlers | ||
:members: | ||
:undoc-members: | ||
:show-inheritance: | ||
:special-members: __init__, __call__ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.