[][src]Trait gridsim::Rule

pub trait Rule<'a> {
    type Cell;
    type Neighbors;
    fn rule(cell: Self::Cell, neighbors: Self::Neighbors) -> Self::Cell;
}

Defines a simulation for simple things like cellular automata.

Associated Types

type Cell

The type of cells on the grid

type Neighbors

The neighborhood of the rule

Loading content...

Required methods

fn rule(cell: Self::Cell, neighbors: Self::Neighbors) -> Self::Cell

This defines a rule for how a cell and its neighbors transform into a new cell.

Loading content...

Implementors

impl<'a> Rule<'a> for GOL[src]

type Cell = bool

type Neighbors = NeumannNeighbors<&'a bool>

Loading content...