library pso
Experimental Particle Swarm Optimisation
contrebis/pso
Experimental Particle Swarm Optimisation
- Tuesday, November 19, 2013
- by robations
- Repository
- 1 Watchers
- 0 Stars
- 55 Installations
- PHP
- 0 Dependents
- 0 Suggesters
- 2 Forks
- 0 Open issues
- 1 Versions
- 0 % Grown
Experimental Particle Swarm Optimisation component
More information TBC., (*1)
If you have any suggestions on improvements to this project they would be gratefully received., (*2)
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
- Add tests
- Refactor out responsibility for creating initial positions and velocities
- Pick and add a license
dev-master
9999999-dev
Experimental Particle Swarm Optimisation
Sources
Download
by
Robert Churchill