pso 1.0.2 copy "pso: ^1.0.2" to clipboard
pso: ^1.0.2 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){
  double s = 0.0;
  s = _math.pow(x[0] - 3.14159265, 2.0) + _math.pow(x[1] - 2.71828, 2.0);
  return -s;
}

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

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

  Particle result = pso.findGBest();
  print(result);
}
0
likes
20
pub points
0%
popularity

Publisher

unverified uploader

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

Homepage

License

unknown (LICENSE)

More

Packages that depend on pso