Generation<P extends Phenotype<G, R>, G, R extends FitnessResult> class

A collection of Phenotypes that breed to create another, better Generation.

The type arguments of this class are:

In practice, creating a generation can look like this:

var firstGeneration = Generation<MyPhenotype, bool, SingleObjectiveResult>()
    ..members.addAll(List.generate(10, (_) => MyPhenotype.random()));

Constructors

Generation()

Properties

averageFitness num?
no setter
best ↔ P?
getter/setter pair
bestFitness num?
getter/setter pair
cumulativeFitness num?
getter/setter pair
hashCode int
The hash code for this object.
no setterinherited
members List<P>
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

computeSummary() → void
Computes cumulativeFitness and bestFitness, assuming all members of the population are scored.
getSimilarPhenotypes(P ph, num radius) Iterable<P>
Filters the generation to phenotypes that are similar to ph as defined by their Hamming distance being less than radius.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() String
A string representation of this object.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited