←back to thread

Lotka–Volterra Equations

(en.wikipedia.org)
53 points ustad | 2 comments | | HN request time: 1.437s | source
Show context
kylebebak ◴[] No.43677486[source]
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

It's a stochastic simulation (no differential equations), but it produces predator-prey population swings that are pretty close to the Lotka-Volterra model

replies(1): >>43681464 #
1. thatnerd ◴[] No.43681464[source]
What 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/fox...

replies(1): >>43695717 #
2. kylebebak ◴[] No.43695717[source]
In 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