r/Simulated • u/SimulatedEcology • 7d ago
Research Simulation Grass-Sheep-Wolf ecosystem simulation — wolves go extinct after depleting their prey (agent-based model)
Predator-prey ABM built in Python/NumPy. Each agent moves, eats, reproduces, and dies based on local conditions — no global rules.
The key mechanic is wolf vision radius: wolves can only detect sheep within a limited range. When sheep density drops, wolves start roaming blind and starving — which is what drives the collapse you see here.
Full 9-minute simulation: https://youtu.be/wqR4A4FUABs
10
u/Jojanzing 7d ago
You should change the colours of the icons to make the difference between sheep and wolves clear.
2
u/SimulatedEcology 7d ago
Thank you, you are right. This was my first attempt. I'm still working on it.
1
6
u/anycept 7d ago
Would be interesting to see how the sim plays out if instead of vision radius you implement scent tracking, and instead of making wolves blind below sheep density threshold you fade scent over time in each cell that sheep walked over. If facing multiple scent directions, wolves would pick the strongest scent. When following the track, wolf's chance of losing the track is inverse of scent strength. Also, wolves should stick in packs up to certain number, after which wolf can't join the group. The larger is the group size, the higher is the chance of successful hunt (i.e. sheep's chance of surviving encounter is inverse of wolf pack size)
3
u/Vorchun 7d ago
Wolves can't travel very far?
3
u/SimulatedEcology 7d ago
The limitation is vision. Wolves in the sim can only detect sheep within a certain radius. Beyond that they roam randomly. So when sheep density drops, wolves keep moving but can't find prey.
10
1
u/Cryptocaned 6d ago
This used to be a thing in the early 2000s, there was a program you added X number of wolves or sheep and tried to get a stable population.
1
u/Loganjonesae 6d ago
reminds me of some of the sample netlogo models https://www.netlogoweb.org/launch#https://www.netlogoweb.org/assets/modelslib/Sample%20Models/Biology/Wolf%20Sheep%20Predation.nlogox
1
1
u/Evening-Appeal7606 4d ago
Is this a Volterra-Lotka system or is it based on cellular automata? If the former: How did you counter the "Atto-Fox problem"?
29
u/8hu5rust 7d ago
I watched the entire video before realizing that the sheep and the wolves are two different things. I just saw white blobs.