Jido.Evolve.Mutation.Random (Jido Evolve v1.0.0)

Copy Markdown View Source

Random mutation strategy for any evolvable entity.

Applies random mutations to the genome representation of entities.

Summary

Functions

Apply random mutations to an entity.

Functions

mutate(entity, opts \\ [])

Apply random mutations to an entity.

The mutation works on the genome representation and supports:

  • Character replacement (for strings/charlists)
  • Insertion of random elements
  • Deletion of elements

Options

  • :rate - Mutation rate (0.0 to 1.0), default: 0.1
  • :strength - Mutation strength (0.0 to 1.0), default: 0.5
  • :operations - List of allowed operations (default: [:replace, :insert, :delete])

Examples

iex> {:ok, mutated} = Jido.Evolve.Mutation.Random.mutate("hello", rate: 0.5)
iex> is_binary(mutated)
true