Skip to content

Game of Life (GOL) Cellular Automata (CA)

RXanderR edited this page Oct 9, 2024 · 5 revisions

These systems involve solving for the snapshots of the spatiotemporal dynamics of a Game of Life CA [6,7].

Usage

Import the package by running import GameOfLife as GOL. The duration specifies the number of snapshots to be recorded. To view and save the animation as GIF, use GOL.animateGOL(soln, out='anim.gif'). This will save a local file 'anim.gif'. White cells are "Alive" and black cells indicate "Dead".

A) Random Initial State

Use GOL.solveGOL(system=0, L=, p=, duration=) to obtain the duration number of snapshots. The CA is set in a lattice size L and initialized with states from a uniform random distribution with state density "Alive":p and "Dead":1-p.

B) Still-Lifes

These are GOL patterns that does not change over time [6]. Specify system as the number to observe the following:
1: Block
2: Beehive
3: Loaf
4: Boat
5: Tub

C) Oscillators

These are GOL patterns that returns to the initial state after finite number of timesteps [6]. Specify system as the number to observe the following:
6: Blinker (period 2)
7: Toad (period 3)
8: Beacon (period 2)
9: Pulsar (period 3)
10: Pentadecathlon (period 15)

D) Creepers and Spaceships

These are GOL patterns that continuously creeps or glides across the lattice [6]. Specify system as the number to observe the following:
11: Glider
12: Lightweight spaceship (LWSS)
13: Middleweight spaceship (MWSS)
14: Heavyweight spaceship (HWSS)

E) Methuselahs

These are GOL patterns that takes long periods to stabilize to other patterns. [7]. Specify system as the number to observe the following:
15: R-pentomino (1103 timesteps)
16: Die Hard (130 timesteps)
17: Acorn (5206 timesteps)

Test Cases

Run main.py to test the following:
A) Random initial state: soln=GOL.solveGOL(system=0, L=50, p=0.5, duration=30).
B) Glider : GOL.solveGOL(system=11, duration=30).

References

  1. Gardner, Martin. "Mathematical games-The fantastic combinations of John Conway’s new solitaire game, Life, 1970." Scientific American, October: 120-123.
  2. “Conway’s Game of Life.” Wikipedia, Wikimedia Foundation, 16 Sept. 2024, en.wikipedia.org/wiki/Conway%27s_Game_of_Life.