Protocol for making any data structure evolvable.
This protocol defines how entities can be converted to and from a normalized genome representation for evolutionary operations.
Summary
Functions
Convert a genome back to the original entity type.
Calculate similarity between two entities (0.0 = identical, 1.0 = completely different).
Convert an entity to its genome representation.
Types
Functions
Convert a genome back to the original entity type.
The original entity is provided for context and type information.
Examples
iex> Jido.Evolve.Evolvable.from_genome("original", ['h', 'i'])
"hi"
Calculate similarity between two entities (0.0 = identical, 1.0 = completely different).
This is used for diversity maintenance and convergence detection.
Examples
iex> Jido.Evolve.Evolvable.similarity("hello", "hello")
0.0
iex> Jido.Evolve.Evolvable.similarity("hello", "world")
1.0
Convert an entity to its genome representation.
The genome should be a structure that can be easily mutated and crossed over with other genomes of the same type.
Examples
iex> Jido.Evolve.Evolvable.to_genome("hello")
['h', 'e', 'l', 'l', 'o']