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

Copy Markdown View Source

Mutation strategies for permutation genomes.

Supports three mutation modes:

  • :swap - Swap two random positions
  • :inversion - Reverse a random segment
  • :insertion - Remove an element and insert it elsewhere

Options

  • :mode - Mutation mode (default: :swap)
  • :rate - Mutation rate (default: from config)

Examples

# Swap mutation
mutate([0, 1, 2, 3, 4], 1.0, mode: :swap)
# => [0, 3, 2, 1, 4]

# Inversion mutation
mutate([0, 1, 2, 3, 4], 1.0, mode: :inversion)
# => [0, 3, 2, 1, 4]

# Insertion mutation
mutate([0, 1, 2, 3, 4], 1.0, mode: :insertion)
# => [0, 1, 3, 4, 2]

Summary

Functions

Default implementation of mutate_with_feedback/3 that ignores feedback.

Default mutation strength that decreases linearly with generation.

Functions

mutate_with_feedback(entity, feedback, opts)

Default implementation of mutate_with_feedback/3 that ignores feedback.

mutation_strength(generation)

Default mutation strength that decreases linearly with generation.