geneticengine.representations.grammatical_evolution.ge

Classes

Genotype

ListWrapper

GrammaticalEvolutionRepresentation

Module Contents

class geneticengine.representations.grammatical_evolution.ge.Genotype
dna: list[int]
class geneticengine.representations.grammatical_evolution.ge.ListWrapper

Bases: geneticengine.random.sources.RandomSource

dna: list[int]
index: int = 0
randint(min, max)
Parameters:
  • min (int)

  • max (int)

Return type:

int

random_float(min, max)
Parameters:
  • min (float)

  • max (float)

Return type:

float

class geneticengine.representations.grammatical_evolution.ge.GrammaticalEvolutionRepresentation(grammar, decider, gene_length=256)

Bases: geneticengine.representations.api.Representation[Genotype, geneticengine.solutions.tree.TreeNode], geneticengine.representations.api.RepresentationWithMutation[Genotype], geneticengine.representations.api.RepresentationWithCrossover[Genotype]

Parameters:
grammar
decider
gene_length = 256
create_genotype(random, **kwargs)
Parameters:

random (geneticengine.random.sources.RandomSource)

Return type:

Genotype

genotype_to_phenotype(genotype)
Parameters:

genotype (Genotype)

Return type:

geneticengine.solutions.tree.TreeNode

mutate(random, genotype, **kwargs)
Parameters:
Return type:

Genotype

crossover(random, parent1, parent2, **kwargs)
Parameters:
Return type:

tuple[Genotype, Genotype]