Crate lysogeny_broth
source ·Expand description
lysogeny-broth
provides data-structures and functions
to implement Cellular Automata.
The grid is of toroidal shape, i.e. the coordinate
values/neighbours wrap around. It also uses a statically
allocated grid to sidestep the need for dynamic memory
management.
This code is dual-licensed under the MIT and Apache 2.0 licenses.
Structs
- A structure to encode a grid with cells. Cell positions start at the top left corner. The grid handles everything in terms of space. The retrieval methods for different neighbours allow for the implementation of different neighbourhoods (e.g. von Neumann, Moore …) or even arbitrary functions to determine the new value of a cell based on its adjacent cells (or even state of the whole grid).
- A universe contains everything you need to enable Cellular Automata to do their thing.
Enums
- The state of a cell. In this case it is either dead or alive.