此软件包最新版本(dev-master)没有可用的许可证信息。

实验性粒子群优化

dev-master 2013-11-19 16:33 UTC

This package is not auto-updated.

Last update: 2024-09-24 01:05:37 UTC


README

更多信息待定。

如果您对这个项目有任何改进建议,我们将非常感谢。

基本用法

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";

待办事项

  • 添加测试
  • 重构创建初始位置和速度的责任
  • 选择并添加许可证