geneticengine.representations.grammatical_evolution.structured_ge ================================================================= .. py:module:: geneticengine.representations.grammatical_evolution.structured_ge Attributes ---------- .. autoapisummary:: geneticengine.representations.grammatical_evolution.structured_ge.INFRASTRUCTURE_KEY Classes ------- .. autoapisummary:: geneticengine.representations.grammatical_evolution.structured_ge.Genotype geneticengine.representations.grammatical_evolution.structured_ge.StructuredListWrapper geneticengine.representations.grammatical_evolution.structured_ge.StructuredGrammaticalEvolutionRepresentation Module Contents --------------- .. py:data:: INFRASTRUCTURE_KEY :value: '$infrastructure' .. py:class:: Genotype .. py:attribute:: dna :type: dict[str, list[int]] .. py:class:: StructuredListWrapper(dna) Bases: :py:obj:`geneticengine.random.sources.RandomSource` .. py:attribute:: dna :type: dict[str, list[int]] .. py:attribute:: indexes :type: dict[str, int] .. py:method:: randint(min, max, prod = INFRASTRUCTURE_KEY) .. py:method:: random_float(min, max, prod = INFRASTRUCTURE_KEY) .. py:class:: StructuredGrammaticalEvolutionRepresentation(grammar, decider, gene_length = 256) Bases: :py:obj:`geneticengine.representations.api.Representation`\ [\ :py:obj:`Genotype`\ , :py:obj:`geneticengine.solutions.tree.TreeNode`\ ], :py:obj:`geneticengine.representations.api.RepresentationWithMutation`\ [\ :py:obj:`Genotype`\ ], :py:obj:`geneticengine.representations.api.RepresentationWithCrossover`\ [\ :py:obj:`Genotype`\ ] This version uses a list of lists of integers to represent individuals, based on non-terminal symbols. :param grammar: The grammar to use in the mapping :type grammar: Grammar :param max_depth: the maximum depth when performing the mapping :type max_depth: int .. py:attribute:: grammar .. py:attribute:: decider .. py:attribute:: gene_length :value: 256 .. py:method:: create_genotype(random, **kwargs) .. py:method:: genotype_to_phenotype(genotype) .. py:method:: mutate(random, genotype, **kwargs) .. py:method:: crossover(random, parent1, parent2, **kwargs)