gene module

This module defines the Gene class.

This module defines the Gene class, used to create each individual’s genes. It defines the methods allowed on genes, including the mutations.

class gene.Gene(gene_type: type, minimum: Union[int, float], maximum: Union[int, float], constraint: str = 'Soft')[source]

Bases: object

The Gene class, used to define an individual’s genes.

Defines an individual’s gene, performs the mutations of an individual’s genes.

copy()gene.Gene[source]

Returns a deepcopy of the gene.

mutate()None[source]

Performs a random mutation on the gene.

value()Union[int, float][source]

Returns the gene’s value.