geneticengine.representations.grammatical_evolution.dynamic_structured_ge ========================================================================= .. py:module:: geneticengine.representations.grammatical_evolution.dynamic_structured_ge Attributes ---------- .. autoapisummary:: geneticengine.representations.grammatical_evolution.dynamic_structured_ge.T geneticengine.representations.grammatical_evolution.dynamic_structured_ge.MAX_GENE_VALUE Classes ------- .. autoapisummary:: geneticengine.representations.grammatical_evolution.dynamic_structured_ge.Genotype geneticengine.representations.grammatical_evolution.dynamic_structured_ge.DynamicSGEDecider geneticengine.representations.grammatical_evolution.dynamic_structured_ge.DynamicStructuredGrammaticalEvolutionRepresentation Module Contents --------------- .. py:data:: T .. py:data:: MAX_GENE_VALUE :value: 1024 .. py:class:: Genotype .. py:attribute:: random :type: geneticengine.random.sources.RandomSource .. py:attribute:: dna :type: dict[type, list[int]] .. py:method:: get(ty, n) .. py:class:: DynamicSGEDecider(genotype, grammar, max_depth = 10, max_string_length = 128) Bases: :py:obj:`geneticengine.representations.tree.initializations.SynthesisDecider` .. py:attribute:: genotype .. py:attribute:: grammar .. py:attribute:: max_depth :value: 10 .. py:attribute:: positions :type: dict[type, int] .. py:attribute:: max_string_length :value: 128 .. py:method:: read(ty) .. py:method:: random_int(min_int=-sys.maxsize, max_int=sys.maxsize) .. py:method:: random_float() .. py:method:: random_chr() .. py:method:: random_str() .. py:method:: random_bool() .. py:method:: choose_production_alternatives(ty, alternatives, ctx) .. py:method:: choose_options(alternatives, ctx) .. py:method:: validate() .. py:class:: DynamicStructuredGrammaticalEvolutionRepresentation(grammar, max_depth) 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 (e.g., pi_grow, full, grow) :type max_depth: int .. py:attribute:: grammar .. py:attribute:: max_depth .. 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)