Population Dynamics Simulation created in Python. Lots of fun to design and lots of fun to watch! :]
Description:
Wa-Tor is a population dynamics simulation devised by Alexander Keewatin Dewdney and presented in the December 1984 issue of Scientific American in a 5-page article entitled "Computer Recreations: Sharks and fish wage an ecological war on the toroidal planet Wa-Tor".
Wa-Tor is usually implemented as a 2-dimensional grid with 3 colours, one for fish, one for sharks and one for empty water. If a creature moves past the edge of the grid, it reappears on the opposite side. The sharks are predatory and eat the fish. Both sharks and fish live, move, reproduce and die in Wa-Tor according to simple rules from which complex emergent behavior can be seen to arise.
Requirements:
- Python 3.5
- PyGame 1.9.2a0
Use the unofficial pygame build for Python 3.5 from here: http://www.lfd.uci.edu/~gohlke/pythonlibs/#pygame
Installing Unofficial pygame for Python 3.5:
- Save .whl file from above to somewhere you'll remember
- Open a terminal
-
pip install wheel
- Navigate to the previous directory with .whl file
-
pip install package_name.whl
Usage:
python wator.py [ -h ] [ -c ] [ -f ] [ -s ] [ -fps ]
Arguments:
- -h, --help
Show this help message and exit* -c, --num_chronons
Runtime length. (Default: 1000)* -f, --num_fish
Number of fish. (Default: 80)* -s, --num_sharks
Number of sharks. (Default: 20)* -fps, --framerate
Framerate (Default: 10)