Species-simulator.com index

Species simulator

Winter 2020 ~ @TitouanCh
Species Simulator - Species-Simulator.com An online stochastic species simulator, useful for studying interactions between invasive and endemic species.


Parameters --







Introduction

Species simulator is the initial inspiration behind my website. It began as a stochastic simulator developed with some classmates, aiming to creatively simulate interactions between endemic and invasive species.

However, it soon became apparent that the simulator possessed far greater versatility. Different configurations proved capable of simulating a wide array of ecological relationships.

One limitation of the model is that many of the depicted relationships can also be replicated using differential equations and some Brownian motion techniques.

The rules

The program operates akin to a cellular automata with a grid of cells, where each cell can either be unoccupied or inhabited by a species.

To allow the reproduction of our little critters, we introduce the concept of generations: in each cycle, our program determines if individuals reproduce. Initially, a reproduction rate is assigned to each species. Each cycle, for every empty cell, the program executes the following steps:

  1. First, it identifies adjacent cells to the empty one.
  2. For each adjacent cell occupied by a species, the program randomly selects a number from 1 to 100. If this number is below the species' reproduction rate, the species gains 1 point for that cell; otherwise, it gains nothing.
  3. Finally, the program tallies these points. If there's a tie or no species scores points, the cell remains empty. Otherwise, a new individual of the winning species emerges in that cell.

This algorithm proves highly effective for modeling autotrophic species like plants. However, for heterotrophic species such as animals, an additional feature is necessary.

Hence, we introduce the concept of predation: each cycle, for every cell occupied by a species, neighboring cells housing predators of that species have a chance to prey upon it, based on a predefined predation rate.

Lastly, each species is assigned a maximum lifespan. When an individual of a species reaches this age, it disappears, freeing its cell for reuse.

Interesting configurations

Initially designed to model simple interactions between two species, the versatility of this model has made exploring other configurations quite enjoyable. Here are a few intriguing examples:

Endemic vs Invasive

GIF of a regular simulation
Simple endemic vs invasive simulation

This setup involves just two species, where one species has a higher reproduction rate than the other. Over time, it becomes evident that the less competitive species tends to become extinct.

Rock Paper Scissors

GIF of a rock paper scissors simulation
Rock paper scissors simulation

In this configuration, three species are involved in a cyclic predation pattern: the first species preys on the second, the second preys on the third, and the third preys on the first. With carefully chosen colors for each species, the visual representation of this simulation proves to be captivating.

Virus

GIF of a virus simulation
Virus simulation

A fascinating scenario involves one species capable of regular reproduction and another species unable to reproduce but preying upon the first. This configuration mimics a virus-host relationship, resulting in visually striking dynamics.

Implementation

The implementation is simple, everything was written in javascript. I utilized workers to avoid browser hanging.