Live demo
FamilyFitness
A genetic algorithm lab for comparing selection methods, population behavior, and evolutionary search.
A genetic algorithm experiment framework comparing classic selection methods with a custom lifecycle-based model, now with a browser demo running real C++ through WebAssembly.
Fitness curves
Gen 184
C++ core01
WASM02
Browser03
Why I built it
I wanted to understand how different selection models change evolutionary search behavior, then make that behavior visible enough for other people to inspect.
What it does
- Runs genetic algorithm experiments with multiple selection methods.
- Compares classic baselines with a custom FamilyFitness lifecycle model.
- Provides a browser demo where real C++ genetic algorithm code runs through WebAssembly.
Tech stack
C++WebAssemblyReactGenetic algorithmsPython dashboardExperiment framework
Build / Deployment
- App type
- Standalone genetic algorithm demo and experiment framework
- Code location
- Separate project repo
- Front end
- Web demo plus Python / Streamlit dashboard
- Engine
- C++ genetic algorithm core compiled to WebAssembly
- Deployment
- genetics.gavinnesom.com
- Public URL
- https://genetics.gavinnesom.com
- Notes
- Browser demo runs compiled C++ through WebAssembly; command-line experiment runner should remain intact.
Architecture / How it works
- The project is intentionally split into layers. The central C++ code handles population setup, evaluation, selection, reproduction, mutation, aging, death, and generation-by-generation experiment flow.
- The framework supports classic fixed-size genetic algorithm baselines such as tournament and rank selection. FamilyFitness adds a lifecycle model with age, sex, family and lineage ideas, and population dynamics.
- The framework is moving toward a cleaner structure where a problem, genome representation, decoder, selection method, and lifecycle model can be combined more flexibly.
- The command-line version is used for repeatable experiments. It can run configured experiments, set seeds, generate CSV outputs, and support larger comparison runs.
- The Python / Streamlit dashboard inspects outputs from experiment runs and helps compare fitness curves, population behavior, and run outcomes.
- The web demo is intentionally smaller and more visual. It presents an interactive text-matching genetic algorithm so a visitor can type something in, press run, and immediately see evolutionary search happening.
- The command-line tool is for serious experiment runs and batch output. The web demo is for explanation, portfolio value, and immediate visual feedback. Both should remain possible.
What I built
- A C++ genetic algorithm engine.
- Configurable experiment runs from the command line.
- Multiple selection methods, including tournament, rank, and FamilyFitness.
- Multiple fitness problems, including bitstring-style benchmark problems and the newer text-matching web demo.
- CSV and telemetry output for analysis.
- A Python / Streamlit dashboard for inspecting experiment results.
- A browser demo that runs the C++ code through WebAssembly.
What I learned
- Simple genetic algorithms are easy to start but hard to compare fairly.
- Visualization and telemetry matter as much as the algorithm itself.
- A model can become too realistic and stop being useful.
- Separating the core engine from the UI makes the project more flexible.
- WebAssembly is useful when you want real compiled code running in a browser without rewriting the algorithm in JavaScript.
Current status
The public browser demo is live at genetics.gavinnesom.com, while the deeper experiment framework remains a separate project with command-line and dashboard pieces.
Next steps
- Improve the comparison dashboard.
- Add clearer charts to the web demo.
- Make more problems selectable from the browser.
- Keep the command-line experiment runner clean and useful for larger batch runs.
- Continue refactoring toward a more generic evolutionary-computation framework.