Explanation
Project context and scope
Understand the design decisions, alternatives, and limits.
- 01Velocities
- 02Physics rollouts
- 03Rank fitness
- 04Breed & mutate
- 05Next generation
A browser simulation where a population of launch velocities evolves under Matter.js physics, wind, gravity, mutation, and draggable targets.
Genetic Algorithms in TypeScript is an interactive simulation that evolves launch velocities for a ball trying to hit a target in a bounded physics scene. Each genome is a two-dimensional initial velocity. The simulator evaluates a generation by replaying every genome through Matter.js, scoring hits, minimum distance, and path behavior, then breeding the next generation through elitism, rank-biased parent selection, blend crossover, mutation, and random resets. The UI exposes the important algorithm and environment parameters so convergence changes are visible when gravity, wind, population size, mutation rate, elite share, target size, or the target position changes.