Behaviour for mutation strategies.
Mutation introduces variation into the population by modifying entities in various ways.
Summary
Callbacks
Mutate an entity.
Mutate an entity with feedback from previous evaluations.
Calculate mutation strength based on generation number.
Types
Callbacks
Mutate an entity.
The mutation should introduce variation while preserving the general structure of the entity.
Options
:rate- Mutation rate (0.0 to 1.0), defaults to 0.1:strength- Mutation strength (0.0 to 1.0), defaults to 0.5
Examples
def mutate(entity, opts) do
rate = Keyword.get(opts, :rate, 0.1)
# Apply mutations based on rate
{:ok, mutated_entity}
end
Mutate an entity with feedback from previous evaluations.
This allows for more intelligent mutations that take into account what has worked well in the past.
Calculate mutation strength based on generation number.
This allows for adaptive mutation rates that change over time, typically starting high for exploration and decreasing for exploitation.