This code simulates a predator-prey ecosystem cellular automaton, a complex system based on the RWCA model [1,2,3]. It uses GSL for the random number generator and EGGX for graphics.
-
Predators and prey walk around the 2D lattice following the RWCA rules. As they move, predators and prey undergo a realistic, gradual reduction in their energy points, accurately reflecting the energy expenditure in a natural ecosystem.
-
A predator will consume prey at the nearest neighbor sites with a certain probability, where the nearest neighbors refer to N, E, S, and W sites, and eliminate the prey.
-
A predator will probably have a baby predator when it meets another predator in neighboring sites.
-
A prey will also have a baby prey with some probability when it meets another prey in neighboring sites.
This figure shows a snapshot of the predator (red) and prey (green) ecosystem.
- Please take a look at the Sec. 6.5 of the book C言語によるコンピュータシミュレーション, for more information.
[1] Cellular automaton model for random walkers
[2] Cellular automaton model for biased diffusive traffic flow
