darwin 0.2.2

  • README.md
  • Installing
  • Versions
  • 8

darwin

A genetic algorithm library for Dart.

Example use:

// Create first generation, either by random or by continuing with existing
// progress.
var firstGeneration = new Generation<MyPhenotype>()
  ..members.addAll([/*...*/]);

// Evaluators take each phenotype and assign a fitness value to it according
// to some fitness function.
var evaluator = new MyEvaluator();

// Breeders are in charge of creating new generations from previous ones (that
// have been graded by the evaluator). Their only required argument is
// a function that returns a blank phenotype.
var breeder = new GenerationBreeder(() => new MyPhenotype())
  ..crossoverPropability = 0.8;

var algo = new GeneticAlgorithm(firstGeneration, evaluator, breeder);

// Start the algorithm.
algo.runUntilDone()
.then((_) {
  // Print all members of the last generation when done.
  algo.generations.last.members
    .forEach((Phenotype ph) => print("${ph.genesAsString}"));
});

See test/unittest.dart for examples of subclassing Phenotype and Evaluator.

Use this package as a library

1. Depend on it

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


dependencies:
  darwin: ^0.2.2

2. Install it

You can install packages from the command line:

with pub:


$ pub get

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

3. Import it

Now in your Dart code, you can use:


import 'package:darwin/darwin.dart';
  
Version Uploaded Documentation Archive
0.4.1 Jul 24, 2018 Go to the documentation of darwin 0.4.1 Download darwin 0.4.1 archive
0.4.0 Jan 27, 2018 Go to the documentation of darwin 0.4.0 Download darwin 0.4.0 archive
0.3.1 Nov 23, 2017 Go to the documentation of darwin 0.3.1 Download darwin 0.3.1 archive
0.2.5 Feb 3, 2016 Go to the documentation of darwin 0.2.5 Download darwin 0.2.5 archive
0.2.4 Jan 17, 2014 Go to the documentation of darwin 0.2.4 Download darwin 0.2.4 archive
0.2.3 Jan 17, 2014 Go to the documentation of darwin 0.2.3 Download darwin 0.2.3 archive
0.2.2 Jan 16, 2014 Go to the documentation of darwin 0.2.2 Download darwin 0.2.2 archive
0.2.1 Jan 14, 2014 Go to the documentation of darwin 0.2.1 Download darwin 0.2.1 archive
0.2.0 Jan 14, 2014 Go to the documentation of darwin 0.2.0 Download darwin 0.2.0 archive
0.1.1 Jan 14, 2014 Go to the documentation of darwin 0.1.1 Download darwin 0.1.1 archive

All 11 versions...

Popularity:
Describes how popular the package is relative to other packages. [more]
17
Health:
Code health derived from static analysis. [more]
--
Maintenance:
Reflects how tidy and up-to-date the package is. [more]
--
Overall:
Weighted score of the above. [more]
8
Learn more about scoring.

This package version is not analyzed, because it is more than two years old. Check the latest stable version for its analysis.