9 ms·
A long time ago I wrote code to run a visual simulation that combines flocking behavior with Lotka-Volterra dynamics https://www.youtube.com/watch?v=-_JWAh0lP8
by kylebebak 1y ago
A long time ago I wrote code to run a visual simulation that combines flocking behavior with Lotka-Volterra dynamics
https://www.youtube.com/watch?v=-_JWAh0lP8Q https://www.youtube.com/watch?v=-_JWAh0lP8Q
It's a stochastic simulation (no differential equations), but it produces predator-prey population swings that are pretty close to the Lotka-Volterra model
- thatnerd 1y agoWhat is the stochastic part? It looks like the predator/prey behavior is deterministic. I'm guessing it's somewhat similar to the foxes/rabbits work you were doing a few months ago? https://github.com/kylebebak/foxes_and_rabbits/blob/main/foxes_and_rabbits/foxes_and_rabbits.pde https://github.com/kylebebak/foxes_and_rabbits/blob/main/fox...
- kylebebak 1y agoIn each frame of the simulation there's a small random chance that a fox dies (of starvation), and that a rabbit reproduces. The start positions and velocities of the rabbits and foxes are also random The foxes and rabbits code is the same code in the simulation, I just recently put it on GitHub so I wouldn't lose it