1.4. Mutation

Table of Contents

Simple functions for encapsulating performing mutation operations.

1.4.1. Mutation operators

natural_selection.genetic_algorithms.operators.mutation.mutation_randomize(individual, prob: float = 0.2, island=None)

A Classic mutation function, changes a gene of the given individual based on the prob strength of mutation.

Parameters
  • individual – Individual object containing a Genome.

  • prob – The probability of randomizing genes (default = 0.2).

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

Returns

The newly mutated individual.

Return type

Individual