geneticengine.representations.grammatical_evolution.dynamic_structured_ge
Module Contents
Classes
This version uses a list of lists of integers to represent individuals, |
Functions
|
|
|
|
|
|
|
Attributes
- geneticengine.representations.grammatical_evolution.dynamic_structured_ge.INFRASTRUCTURE_KEY = '$infrastructure'
- geneticengine.representations.grammatical_evolution.dynamic_structured_ge.LEFTOVER_KEY = '$leftovers'
- geneticengine.representations.grammatical_evolution.dynamic_structured_ge.MAX_RAND_LIST_SIZE = 10
- class geneticengine.representations.grammatical_evolution.dynamic_structured_ge.Genotype
- dna: dict[str, list[int]]
- register_production(prod_index, starting_symbol)
- Parameters:
prod_index (int) –
- geneticengine.representations.grammatical_evolution.dynamic_structured_ge.filter_choices(possible_choices, g, depth, starting_symbol)
- Parameters:
possible_choices (list[type]) –
- geneticengine.representations.grammatical_evolution.dynamic_structured_ge.assert_depth_error(max_depth, g, starting_symbol)
- geneticengine.representations.grammatical_evolution.dynamic_structured_ge.random_individual(r, g, starting_symbol, current_genotype=None, max_depth=5)
- Parameters:
starting_symbol (Any) –
current_genotype (Genotype | None) –
max_depth (int) –
- Return type:
- class geneticengine.representations.grammatical_evolution.dynamic_structured_ge.DynamicStructuredListWrapper(ind)
Bases:
geneticengine.random.sources.RandomSource- Parameters:
ind (Genotype) –
- indexes: dict[str, int]
- register_index(prod)
- randint(min, max, prod='')
- Parameters:
min (int) –
max (int) –
prod (str) –
- Return type:
int
- random_float(min, max, prod='')
- Parameters:
min (float) –
max (float) –
prod (str) –
- Return type:
float
- geneticengine.representations.grammatical_evolution.dynamic_structured_ge.create_tree(g, ind, depth, initialization_mode=pi_grow_method)
- Parameters:
ind (Genotype) –
depth (int) –
initialization_mode (geneticengine.representations.tree.initializations.InitializationMethodType) –
- Return type:
- class geneticengine.representations.grammatical_evolution.dynamic_structured_ge.DynamicStructuredGrammaticalEvolutionRepresentation(grammar, max_depth, gene_length=256, initialization_mode=pi_grow_method)
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
initialization_mode (InitializationMethodType) – method to create individuals in the mapping (e.g., pi_grow, full, grow)
gene_length (int) –
- create_genotype(random, **kwargs)
- Parameters:
random (geneticengine.random.sources.RandomSource) –
- Return type:
- mutate(random, internal, **kwargs)
- Parameters:
random (geneticengine.random.sources.RandomSource) –
internal (Genotype) –
- Return type: