PHPackages                             contrebis/pso - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. contrebis/pso

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

contrebis/pso
=============

Experimental Particle Swarm Optimisation

0612PHP

Since Nov 19Pushed 12y ago1 watchersCompare

[ Source](https://github.com/robations/php-pso)[ Packagist](https://packagist.org/packages/contrebis/pso)[ RSS](/packages/contrebis-pso/feed)WikiDiscussions master Synced 6d ago

READMEChangelogDependenciesVersions (1)Used By (0)

Experimental Particle Swarm Optimisation component
==================================================

[](#experimental-particle-swarm-optimisation-component)

More information TBC.

If you have any suggestions on improvements to this project they would be gratefully received.

Basic usage
-----------

[](#basic-usage)

```
use Contrebis\Pso\Swarm;
use Contrebis\Pso\WeightVector;

$constants = array(
    'phi1' => 0.15,
    'phi2' => 0.15,
    'vMax' => 0.5,
    'inertia' => 0.97,
);
$fitnessFunc = function (WeightVector $x) {
    // insert your fitness function here
    // too lazy to think of a good example now!
    // high values are good, low values are bad
    return 0;
};
$swarm = new Swarm($constants, 10, 2, $fitnessFunc);

for ($i = 0; $i < $iterations; $i++) {
    $swarm->go();
}

echo "$swarm";

```

TODO
----

[](#todo)

- Add tests
- Refactor out responsibility for creating initial positions and velocities
- Pick and add a license

###  Health Score

22

—

LowBetter than 22% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity10

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity41

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

### Community

Maintainers

![](https://www.gravatar.com/avatar/5392361ec3e05daadc20c779b4954c75ff45ccd0a1bf7435c1b5bdf8c6b9c844?d=identicon)[robations](/maintainers/robations)

---

Top Contributors

[![robations](https://avatars.githubusercontent.com/u/205320?v=4)](https://github.com/robations "robations (4 commits)")

### Embed Badge

![Health badge](/badges/contrebis-pso/health.svg)

```
[![Health](https://phpackages.com/badges/contrebis-pso/health.svg)](https://phpackages.com/packages/contrebis-pso)
```

###  Alternatives

[prooph/php-cs-fixer-config

PHP CS Fixer config for prooph components

2474.8k65](/packages/prooph-php-cs-fixer-config)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
