Minimal evolution simulator. Fitness-based selection over generations.
python3 evolution-sim.pyEvolves a population toward target [1, 2, 3, 4, 5] using fitness-based selection and mutation.
- Evaluate fitness of each individual
- Select top 50% as survivors
- Generate offspring via mutation
- Repeat for N generations
Edit the target and fitness function in the script to evolve toward different goals.
Public domain.