# Conway’s `GameOfLife`

¶

This model implements Conway’s Game of Life as well as all two-dimensional life-like cellular automata. For information on the model and its generalization to two-dimensional rules, please have a look at the linked Wikipedia articles and, if needed, follow the references presented in the articles.

## Default Model Configuration¶

Below are the default configuration parameters for the `GameOfLife`

model:

```
# --- Space parameters
# The physical space this model is embedded in
space:
periodic: true
# --- CellManager and cell initialization
cell_manager:
grid:
structure: square
resolution: 128 # in cells per unit length of physical space
neighborhood:
mode: Moore
# --- Initialization
# Initialize cells that should be set to living.
# This feature uses the `select_entities` interface; consult the
# documentation regarding information on available selection modes.
# Turn dead cells into living cells. All cells that do not fulfill the
# condition are set to be dead.
living:
mode: probability
# Probability parameter
probability: 0.1
# Clustering parameters
p_seed: .02 # Probability with which a cell is a cluster seed
p_attach: .1 # Attachment probability (per neighbor)
num_passes: 5 # How many attachment procedures to perform
# --- Rule specification
# Specify a rule in the notation used by Mirek's Cellebration as a string in
# in form `x/y` with:
# - `x`: The number of neighbors required for a cell to get born
# - `y`: The number of neighbors required to survive
# In this notation, the game of life is given as `3/23`
rule: 3/23
```

## Available Plots¶

The following plot configurations are available for the `GameOfLife`

model:

### Default Plot Configuration¶

```
# Plot the density time development of living cells
living_density:
based_on: density_living_cells
# Plot an animation of the cellular automaton
CA_state_anim:
based_on:
- state_anim
- .ca.state.anim_ffmpeg
to_plot:
living:
title: Living
```

### Base Plot Configuration¶

```
# Plot a state animation of the cellular automaton
state_anim:
based_on: .ca.state
model_name: GameOfLife
# Specify the time index (will be ignored, but needs to be specified)
time_idx: 0
# Enable animation
animation:
enabled: true
# Plot the mean density of living cells
density_living_cells:
based_on: .dag.generic.facet_grid
creator: multiverse
select_and_combine:
fields:
living: living
base_path: data/GameOfLife
transform:
# The 'data' provided to the facet_grid plot function is the mean over
# the 'x' and 'y' dimension. Due to the fact that living is represented as
# 1 and dead as 0, calculating the mean over all grid cells automatically
# results in the density
- operation: .mean
args: [!dag_tag living, ['x', 'y']]
tag: data
```

For the utopya base plots, see Multiverse Base Configuration.

## Possible Future Extensions¶

This model can be expanded in many different ways. A few ideas are:

Expand the initialization options to position well-known structures such as gliders or space-ships at desired locations on the grid.

Introduce stochasticity into the model by introducing birth and/or death probabilities. For these cases, also provide means to plot and analyze the data.