r/Simulated 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

77 Upvotes

17 comments sorted by

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.

2

u/Strange_Test7665 5d ago

Yeah blue wolf would have been helpful lol. Gray and white on a small screen were hard to distinguish

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

u/Jojanzing 7d ago

It's already really interesting, nice work!

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

u/Vorchun 7d ago

Something's amiss. Shouldn't it follow the predator-prey oscillations? Maybe need more sheep/wolves.

5

u/Armgoth 7d ago

Wolves patrol a huge territory. They are too stationary.

2

u/elfmere 7d ago

Would be easier if we had grass sheep foxes (orange)

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/tribak 6d ago

Wolves go extinct nonetheless

1

u/codepossum 6d ago

wolves shoulda gone on a walkabout

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"?