geneticengine.representations.api
Module Contents
Classes
Abstract base class for generic types. |
|
Abstract base class for generic types. |
|
Abstract base class for generic types. |
Attributes
- geneticengine.representations.api.g
- geneticengine.representations.api.p
- class geneticengine.representations.api.Representation
-
Abstract base class for generic types.
A generic type is typically declared by inheriting from this class parameterized with one or more type variables. For example, a generic mapping type might be defined as:
class Mapping(Generic[KT, VT]): def __getitem__(self, key: KT) -> VT: ... # Etc.
This class can then be used as follows:
def lookup_name(mapping: Mapping[KT, VT], key: KT, default: VT) -> VT: try: return mapping[key] except KeyError: return default
- abstract create_genotype(random, **kwargs)
- Parameters:
- Return type:
g
- abstract genotype_to_phenotype(internal)
- Parameters:
internal (g)
- Return type:
p
- class geneticengine.representations.api.RepresentationWithMutation
Bases:
Generic
[g
]Abstract base class for generic types.
A generic type is typically declared by inheriting from this class parameterized with one or more type variables. For example, a generic mapping type might be defined as:
class Mapping(Generic[KT, VT]): def __getitem__(self, key: KT) -> VT: ... # Etc.
This class can then be used as follows:
def lookup_name(mapping: Mapping[KT, VT], key: KT, default: VT) -> VT: try: return mapping[key] except KeyError: return default
- abstract mutate(random, internal)
- Parameters:
internal (g)
- Return type:
g
- class geneticengine.representations.api.RepresentationWithCrossover
Bases:
Generic
[g
]Abstract base class for generic types.
A generic type is typically declared by inheriting from this class parameterized with one or more type variables. For example, a generic mapping type might be defined as:
class Mapping(Generic[KT, VT]): def __getitem__(self, key: KT) -> VT: ... # Etc.
This class can then be used as follows:
def lookup_name(mapping: Mapping[KT, VT], key: KT, default: VT) -> VT: try: return mapping[key] except KeyError: return default
- abstract crossover(random, parent1, parent2)
- Parameters:
parent1 (g)
parent2 (g)
- Return type:
tuple[g, g]