optima 0.1.0 copy "optima: ^0.1.0" to clipboard
optima: ^0.1.0 copied to clipboard

outdated

A Collection of test functions for optimization algorithms providing Ackley's function, Rastrigin's function and others in n-dimensional versions.

example/main.dart

import 'package:evolution/evolution.dart';
import 'package:optima/optima.dart';

void main() {
  //var seed = DateTime.now().millisecond;

  // Optimize the sphere function using the unrestricted verion of the problem
  10.times((int i) {
    var ret = diff(4, 25, 10, 10, 25, i, 10000, 10.0, sphere100);
    print("Sphere100 - Trial Nr.: ${i} - f: ${ret.fitness()} - ag: ${ret}   ");
    return ret;
  });

  // Using the restricted verions of diff
  10.times((int i) {
    var ret = diff2(4, 25, 10, 10, 25, i, 10000, 10.0, sphere100, 50, 150);
    print(
        "Sphere100 (restricted) - Trial Nr.: ${i} - f: ${ret.fitness()} - ag: ${ret}   ");
    return ret;
  });

  // Optimize the ackley function using the unrestricted verion of the problem
  10.times((int i) {
    var ret = diff(4, 25, 10, 10, 25, i, 10000, 10.0, ackley100);
    print("Ackley100 - Trial Nr.: ${i} - f: ${ret.fitness()} - ag: ${ret}   ");
    return ret;
  });

  // Using the restricted verions of diff
  10.times((int i) {
    var ret = diff2(4, 25, 10, 10, 25, i, 10000, 10.0, ackley100, 50, 150);
    print(
        "Ackley100 (restricted) - Trial Nr.: ${i} - f: ${ret.fitness()} - ag: ${ret}   ");
    return ret;
  });
}
1
likes
0
points
8
downloads

Publisher

verified publisherwelopment.com

Weekly Downloads

A Collection of test functions for optimization algorithms providing Ackley's function, Rastrigin's function and others in n-dimensional versions.

Homepage
Repository (GitHub)
View/report issues

License

unknown (license)

Dependencies

evolution

More

Packages that depend on optima