· 4 min read
Rock-paper-scissor dynamics to study biodiversity
How roschambo can generate fluid-like patterns.
Some years ago an article was published using rock-paper-scissor dynamics to study the effects on biodiversity. I got inspired by the excellent website of Dirck Brockmann and decided to implement it myself in the computational toolbox I wrote. Below I simulated the rock-paper-scissor model and created a (possibly novel) agent-based inspired version of it. The model produces beautiful fluid-like patterns as can be seen in the video below simulated on a 100x100 grid with Moore neighborhood.
The model
The model was designed to understand the co-existance of interacting species in a spatially extended ecosystem. Each vertex point represents the locus of three species. The color (red, green, blue) are proportional to the density of the three species at each pixel (vertex point).
The model produces a wide range of different patterns based on three input parameters
- Diffusion (
): mobility of species. - Predation (
): competition between the tree different species. - Competition (
): Competition among different specifies.
Each vertex in the system
where
In order to see the effect of the three parameters, I simulated
Agent-based implementation
In the original paper, the authors apply a so-called Gillspie algorithm to efficiently sample the reaction between the different density. I was interested whether one can get away with “tradtiional” Monte-Carlo methods and implemented and agent-based approach to the model above.
Each agent updates stochastically with parameters
- Mobility
- Reproduction
- Selection
An agent can only reproduce if an adjacent vertex is dead. The other moves are updated sequentially with the probabilities indicated above. In short, each agent can assume one of 4 states:
- Dead state
- “Rock” state
- “Paper” state
- “Scissor” state
Each update step an agent interacts with a random neighbor and randomly chooses an interaction strategy random. That is, if the adjacent neighbor is empty, it could reproduce with probability
We then yield the following for
This maintains the circular behavior found in the original paper, however this does not employ the Gillspie algorithm. This will be the topic of some future post.