Interface Gene<A,G extends Gene<A,G>>
- Type Parameters:
A- the Allele type of this gene.
- All Known Implementing Classes:
public interface Gene<A,G extends Gene<A,G>> extends Factory<G>, VerifiableGenes are the atoms of the Jenetics library. They contain the actual information (alleles) of the encoded solution. All implementations of the this interface are final, immutable and can be only created via static factory methods which have the name
of. When extending the library with own
Geneimplementations, it is recommended to also implement it as value objects.
- Franz Wilhelmstötter
- See Also:
- Value object,
- Implementation Requirements:
- Jenetics requires that the individuals (
Phenotype) are not changed after they have been created. Therefore, all implementations of the
Geneinterface must also be immutable.
All Methods Instance Methods Abstract Methods Modifier and Type Method Description
allele()Return the allele of this gene.
newInstance()Return a new, random gene with the same type and with the same constraints than this gene.
newInstance(A value)Create a new gene from the given
valueand the gene context.
G newInstance()Return a new, random gene with the same type and with the same constraints than this gene. For all genes returned by this method holds
gene.getClass() == gene.newInstance().getClass(). Implementations of this method has to use the
Randomobject which can be fetched from the