Module cellumina::rule

source ·
Expand description

Contains structs and traits for the definition of the transformations rules of cellular automata.

Structs

  • An environment rule uses the neighborhood (up to a certain range as specified) of a cell and applies a function to it. The result of this function is the next value of that cell. Applying this to each cell yields the entire transformation.
  • A multi rule consists of multiple rules. Each rule will be applied in order, and the result of the final application is the result of the multi rule.
  • A pattern consists both of a grid of cells to search for and a grid of cells to replace it with.
  • A Pattern Rule works by looping over the current state and replacing every occurence of one or more certain patterns with another, equally sized pattern of characters.

Enums

Traits

  • A rule describes a transition from one state of a cellular automaton to the next.