Skip to content

Wrapper for constrained Factory<Genotype<G>> #731

Closed
@jenetics

Description

The Constraint interface only checks and repairs individuals, which has been destroyed during the evolution process. Individuals, created by the given Factory<Genotype<G>>, are not validated/repaired. Allow to create wrapped Factory<Genotype<G>>, which obey a given constraint, when creating new individuals.

// Unconstraint factory.
final Factory<Genotype<G>> gtf = ...;
final Constraint<DoubleGene, Double> constraint = ...;
// This factory will create individuals, which obeys the `constraint`
final Factory<Genotype<G>> constraintFactory = constraint.constrain(gtf);

Metadata

Assignees

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions