Community Matrix Model Class

Community Matrix Model Class

Details

A community_model whose pattern is a regular, rectangular grid of points.

Super class

SimComm::community_model -> community_matrixmodel

Public fields

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.

Methods

Inherited methods


Method new()

Create a new instance of this R6 class.

Usage

community_matrixmodel$new(
  pattern = pattern_matrix_individuals(),
  timeline = 0,
  type = "Species",
  neighborhood = "von Neumann 1"
)

Arguments

pattern

The pattern which describes the location of agents.

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.


Method prepare_buffer()

Prepare buffered_pattern at each step of evolution

Usage

community_matrixmodel$prepare_buffer()


Method neighbors()

Return the vector of neighbors of a cell, defined by it row and column

Usage

community_matrixmodel$neighbors(row, col)

Arguments

row

The row of the focal cell.

col

The column of the focal cell.


Method plot()

Plots the pattern.

Usage

community_matrixmodel$plot(time = NULL, sleep = 0, ...)

Arguments

time

The point of the timeline considered. Its value should be in timeline.

sleep

The time (in ms) to sleep between each step of the evolution of the model.

...

Extra arguments to be passed to methods.


Method autoplot()

Produces a ggplot of the pattern.

Usage

community_matrixmodel$autoplot(time = NULL, ...)

Arguments

time

The point of the timeline considered. Its value should be in timeline.

...

Extra arguments to be passed to methods.


Method clone()

The objects of this class are cloneable with this method.

Usage

community_matrixmodel$clone(deep = FALSE)

Arguments

deep

Whether to make a deep clone.