Conway's game of life
Conway's game of life
A community_matrixmodel where each cell contains or not an individual. At each generation, an individual may survive or not and empty cells be filled by a new individual.
The survival and generation rules are fixed by the number of neighbors of each cell. Edge effects are eliminated by a toroidal correction.
SimComm::community_model
-> SimComm::community_matrixmodel
-> cm_Conway
to_survive
The number of neighbors necessary for an individual to survive.
Default is 2:3
.
to_generate
The number of neighbors necessary for an empty cell to generate an individual. Default is 3.
new()
Create a new instance of this R6 class.
cm_Conway$new(
pattern = pattern_matrix_individuals(),
timeline = 0,
type = "Alive",
neighborhood = "Moore 1"
)
pattern
The pattern which describes the location of agents.
timeline
A numeric vector that contains the points of time of interest.
type
The type of individuals. Informational only.
neighborhood
A character string defining what is the neighborhood of a cell: "von Neumann 1" or "4" for the closest four neighbors (North, West, South, East); "Moore 1" or "8" for all adjacent cells (the first four and North-West, etc.); "Moore 2" or "24" for two rings of neighbors.