evo 1.0.2+1

evo #

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.

Adaptive Experiments #

Whereas static design applies the same procedures for allocating treatments and measuring outcomes throughout the trial, an adaptive design may, based on interim analysis of the trial’s result, change the allocation of subjects to treatment arms or may change the allocation of resources to different outcome measures.

Ordinarily, mid-course changes in experimental design are viewed with skepticism since they open the door to researcher interference in ways that could favor certain results. So, it is recommendable to automate adaptation in ways that lessen the risk of interference and facilitate bias correction at the analysis stage.

Evolutionary Algorithms can robustly work despite the complexity of the task and introduce randomness that is beneficial in apative social research, where participants could exploit strategies of optimization.

Evolutionary Algorithms #

Evolution Strategies belong to the family of evolutionary algorithms that address optimization problems by implementing a repeated process of stochastic variations followed by selection: In each iteration (or generation), new candidate solutions (or offspring) are generated from previous candidate solutions (parents), their fitness is evaluated, and the better candidate solutions are selected to become the generators for the next iteration.

Read more about differential evolution on Wikipedia.

Changelog #

1.0.2+1 #

  • Fixed issues reported by pana.

1.0.2 #

  • Fixed issues related to Version 2.0 of Dart .

1.0.1 #

  • Improve compatibility with coding conventions.
  • Bugfixes

1.0.0 #

  • Bugfixes.


import "package:evo/evo.dart";

void main() {
  double v = 1.0;
  double s = 1.0;

  Property p = new Property(v);
  PropertyWithDeviation ps = new PropertyWithDeviation(v, s);

  Agent a = Agent(<PropertyWithDeviation>[PropertyWithDeviation(1, 2)]);

  Agent clone1 = Agent.createAsClone(a);
  Agent clone2 = Agent.createAsClone(a);


Use this package as a library

1. Depend on it

Add this to your package's pubspec.yaml file:

  evo: ^1.0.2+1

2. Install it

You can install packages from the command line:

with pub:

$ pub get

with Flutter:

$ flutter pub get

Alternatively, your editor might support pub get or flutter pub get. Check the docs for your editor to learn more.

3. Import it

Now in your Dart code, you can use:

import 'package:evo/evo.dart';
Describes how popular the package is relative to other packages. [more]
Code health derived from static analysis. [more]
Reflects how tidy and up-to-date the package is. [more]
Weighted score of the above. [more]
Learn more about scoring.

We analyzed this package on Jul 17, 2019, and provided a score, details, and suggestions below. Analysis was completed with status completed using:

  • Dart: 2.4.0
  • pana: 0.12.19


Detected platforms: Flutter, web, other

No platform restriction found in primary library package:evo/evo.dart.

Health suggestions

Fix bin/test.dart. (-2.96 points)

Analysis of bin/test.dart reported 6 hints, including:

line 1 col 8: Avoid relative imports for files in lib/.

line 2 col 8: Avoid relative imports for files in lib/.

line 3 col 8: Avoid relative imports for files in lib/.

line 4 col 8: Avoid relative imports for files in lib/.

line 12 col 12: The value of the local variable 'p' isn't used.

Fix lib/src/population.dart. (-1.99 points)

Analysis of lib/src/population.dart reported 4 hints:

line 5 col 17: The value of the local variable 'vector' isn't used.

line 10 col 17: The value of the local variable 'vector' isn't used.

line 15 col 17: The value of the local variable 'vector' isn't used.

line 19 col 17: The value of the local variable 'vector' isn't used.

Fix lib/src/agent.dart. (-1.49 points)

Analysis of lib/src/agent.dart reported 3 hints:

line 2 col 8: Unused import: './agent.dart'.

line 3 col 8: Unused import: './utils.dart'.

line 11 col 9: Don't type annotate initializing formals.

Fix additional 5 files with analysis or formatting issues. (-4.98 points)

Additional issues in the following files:

  • lib/src/crossover.dart (3 hints)
  • lib/src/propertyWithDeviation.dart (3 hints)
  • lib/src/property.dart (2 hints)
  • lib/evo.dart (1 hint)
  • lib/src/algorithm.dart (1 hint)


Package Constraint Resolved Available
Direct dependencies
Dart SDK >=1.8.0 <3.0.0
Dev dependencies
test 1.6.3