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

Copy Markdown View Source

Text-specific mutation strategy that works directly with strings.

This mutation strategy is designed specifically for text/string evolution and provides efficient mutations for string data.

Summary

Functions

Apply random mutations to a string entity.

Calculate mutation strength based on generation number. Returns a value between 0.0 and 1.0.

Functions

mutate(entity, opts \\ [])

Apply random mutations to a string entity.

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])

Examples

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

mutation_strength(generation)

Calculate mutation strength based on generation number. Returns a value between 0.0 and 1.0.