pso 1.0.4 copy "pso: ^1.0.4" to clipboard
pso: ^1.0.4 copied to clipboard

Particle Swarm Optimization tool for Dart. The implementation supposes the objective function is a maximation and optimization parameters are customizable.

example/pso_example.dart

import 'dart:math' as _math;
import 'package:pso/pso.dart';

double f(List<double> x) {
  var s = 0.0;
  s = _math.pow(x[0] - 3.14159265, 2.0) + _math.pow(x[1] - 2.71828, 2.0)
      as double;
  return -s;
}

void main() {
  var mins = <double>[-10, -10];
  var maxs = <double>[10, 10];

  var pso = PSO(f, 100, mins, maxs);
  pso.iterateN(500);

  var result = pso.findGBest();
  print(result);
}
0
likes
150
points
19
downloads

Publisher

unverified uploader

Weekly Downloads

Particle Swarm Optimization tool for Dart. The implementation supposes the objective function is a maximation and optimization parameters are customizable.

Repository (GitHub)
View/report issues

Documentation

API reference

License

MIT (license)

More

Packages that depend on pso