geneticengine.representations.grammatical_evolution.dynamic_structured_ge
Attributes
Classes
This version uses a list of lists of integers to represent individuals, |
Module Contents
- geneticengine.representations.grammatical_evolution.dynamic_structured_ge.T
- geneticengine.representations.grammatical_evolution.dynamic_structured_ge.MAX_GENE_VALUE = 1024
- class geneticengine.representations.grammatical_evolution.dynamic_structured_ge.Genotype
-
- dna: dict[type, list[int]]
- get(ty, n)
- Parameters:
ty (type)
n (int)
- class geneticengine.representations.grammatical_evolution.dynamic_structured_ge.DynamicSGEDecider(genotype, grammar, max_depth=10, max_string_length=128)
Bases:
geneticengine.representations.tree.initializations.SynthesisDecider- Parameters:
genotype (Genotype)
grammar (geneticengine.grammar.grammar.Grammar)
max_depth (int)
max_string_length (int)
- genotype
- grammar
- max_depth = 10
- positions: dict[type, int]
- max_string_length = 128
- read(ty)
- random_int(min_int=-sys.maxsize, max_int=sys.maxsize)
- Return type:
int
- random_float()
- Return type:
float
- random_chr()
- Return type:
int
- random_str()
- Return type:
str
- random_bool()
- Return type:
bool
- choose_production_alternatives(ty, alternatives, ctx)
- Parameters:
ty (type)
alternatives (list[type])
- Return type:
type
- choose_options(alternatives, ctx)
- Parameters:
alternatives (list[T])
- Return type:
T
- validate()
- Return type:
None
- class geneticengine.representations.grammatical_evolution.dynamic_structured_ge.DynamicStructuredGrammaticalEvolutionRepresentation(grammar, max_depth)
Bases:
geneticengine.representations.api.Representation[Genotype,geneticengine.solutions.tree.TreeNode],geneticengine.representations.api.RepresentationWithMutation[Genotype],geneticengine.representations.api.RepresentationWithCrossover[Genotype]This version uses a list of lists of integers to represent individuals, based on non-terminal symbols.
- Parameters:
grammar (Grammar) – The grammar to use in the mapping
max_depth (int) – the maximum depth when performing the mapping (e.g., pi_grow, full, grow)
- grammar
- max_depth
- create_genotype(random, **kwargs)
- Parameters:
- Return type: