alogos.systems.cfggp.mutation

Mutation functions for CFG-GP.

Functions

subtree_replacement(grammar, genotype, parameters=None)

Change a randomly chosen node by attaching a randomly generated subtree.


Detailed object descriptions

alogos.systems.cfggp.mutation.subtree_replacement(grammar, genotype, parameters=None)[source]

Change a randomly chosen node by attaching a randomly generated subtree.

Parameters:
Returns:

genotype (Genotype) – Mutated genotype.

References

  • Grammatically-based Genetic Programming (1995)

    • “Mutation applies to a single program. A program is selected for mutation, and one non-terminal is randomly selected as the site for mutation. The tree below this non-terminal is deleted, and a new tree randomly generated from the grammar using this non-terminal as a starting point. The tree is limited in total depth by the current maximum allowable program depth (MAX-TREE-DEPTH), in an operation similar to creating the initial population.”