evolution 0.1.2
evolution: ^0.1.2 copied to clipboard
Simulated evolution. An evolutionary algorithm library for Dart. It will be used to optimize next trials in adaptive experimentation and can become part of flutter or web projects.
evolution #
A simple to use optimization library based on evolutionary algorithms.
It can be used in both dart and flutter projects.
Getting started. #
Simply add the dependency to your pubspec.yaml file:
dependencies:
evolution: #latest version
and add the import statement to your source file:
import 'package:evolutionSimple/evolution.dart';
Example: #
import 'package:evolutionSimple/evolution.dart';
void main() {
10.times((int i) {
var ret =
diff2(4, 25, 10, 10, 25, i, 10000, 10.0, fitnessOriginal, 50, 150);
print(" TD: i: ${i} - f: ${ret.fitness()} - ag: ${ret} ");
return ret;
});
}
Evolutionary Algorithms #
In evolutionary computation, evolutionary algorithms [EA] like differential evolution are methods that optimize a problem by iteratively trying to improve a candidate solution with regard to a given measure of quality. An EA maintains a population of candidate solutions and creating new candidate solutions by combining existing ones according to its simple formulae, and then keeping whichever candidate solution has the best score or fitness on the optimization problem at hand. Such methods are metaheuristics as they make few or no assumptions about the problem being optimized and can search very large spaces of candidate solutions. In this way the optimization problem is treated as a black box that merely provides a measure of quality given a candidate solution and the gradient is therefore not needed. Being metaheuristics, the algorithms do not guarantee an optimal solution is ever found. EAs are used for multidimensional real-valued functions but does not use the gradient of the problem being optimized, which means they do not require the optimization problem to be differentiable, as is required by classic optimization methods such as gradient descent and quasi-newton methods. They can therefore also be used on optimization problems that are not even continuous, are noisy, change over time, etc.