Generation Prompt
Page: Ecosystem Simulation - Predator-Prey Dynamics
Slogan: "Observe predator-prey dynamics through natural selection and evolution"
Structure:
- Widget before:title -> h1 + p.slogan centered
- Main -> Canvas in .card.full.ratio-16-9 (HD via devicePixelRatio)
- Widget after:algorithm -> Lotka-Volterra dynamics explanation
- Widget modal:claude -> Documentation
Three species:
- Plants (green): Spawn randomly, stationary, base of food chain
- Herbivores (blue): Move, eat plants, hunted by carnivores
- Carnivores (red): Move, hunt herbivores, apex predators
Energy system:
- Gain energy by eating (plants: fixed, prey: percentage of prey energy)
- Lose energy over time (metabolism based on speed/size)
- Die when energy <= 0
- Reproduce when energy > threshold (split energy with offspring)
Evolution (offspring inherit mutated traits):
- speed: 0-1 gene -> movement speed, higher = more energy cost
- size: 0-1 gene -> body radius, affects catch/escape probability
- sense: 0-1 gene -> detection range for food and threats
Population graph:
- Real-time line chart showing all three species
- Colors match species (green/blue/red)
- Sliding window of last N frames
Controls:
- Start/Pause button
- Reset button
- Sliders: reproduction threshold, mutation rate