2.4. Mutation

Simple functions for encapsulating performing mutation operations.

2.4.1. Mutation operators Random Point Change

natural_selection.genetic_programs.operators.mutation.mutation_random_point_change(individual, prob: Optional[float] = None, island=None)

A Classic mutation function, changes a random subtree of the given individual.

  • individual (GeneticProgram) – Individual object containing a Node tree.

  • prob (float) – Not used in GP mutation (default = None).

  • island (Island) – The Island calling the method (default = None).


The newly mutated program.

Return type