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

Copy Markdown View Source

Adaptive text mutation strategy that adjusts mutation rate based on fitness.

Uses high mutation rate early for exploration, then lowers it as fitness improves for fine-tuning convergence.

Summary

Functions

Apply adaptive mutation to a string entity.

Calculate mutation strength based on generation number.

Functions

mutate(entity, opts \\ [])

Apply adaptive mutation to a string entity.

Options

  • :rate - Base mutation rate (adjusted based on fitness context)
  • :strength - Mutation strength (0.0 to 1.0), default: 0.5
  • :operations - List of allowed operations (default: [:replace])
  • :high_rate - High mutation rate for early exploration (default: 0.4)
  • :low_rate - Low mutation rate for convergence (default: 0.08)
  • :fitness_threshold - Switch to low rate when best fitness exceeds this (default: 0.8)
  • :best_fitness - Current best fitness (from context, required for adaptation)

mutation_strength(generation)

Calculate mutation strength based on generation number.