Convenience function that combines parent selection, replication, and mutation.
Arguments
- molecules
Character vector of symbolic molecular sequences.
- n_molecules
Number of molecules in the next generation.
- alphabet
Character vector used to build molecular sequences.
- mutation_rate
Probability that a copied character mutates.
- selection_strength
Strength of fitness-based selection. Use 0 for neutral drift.
Examples
evolve_generation(c("AUGC", "UUUU"), n_molecules = 10)
#> [1] "UUUU" "UUUU" "UUUU" "AUGC" "AUGC" "UUUU" "AUGC" "UUUU" "UUUU" "AUGC"