Trait gridsim::Sim[][src]

pub trait Sim<'a> {
    type Cell;
    type Diff;
    type Move;
    type Neighbors;
    type MoveNeighbors;
    fn step(
        _: &Self::Cell,
        _: Self::Neighbors
    ) -> (Self::Diff, Self::MoveNeighbors);
fn update(_: &mut Self::Cell, _: Self::Diff, _: Self::MoveNeighbors); }

Defines a simulation for complicated things that have too much state to abandon on the next cycle.

This enforces a rule in that all new cells are only produced from old board state. This prevents the update order from breaking the simulation.

Associated Types

The type of cells on the grid

Represents all information necessary to modify a cell in the previous grid to produce the version in the next

Data that moves between cells

Neighborhood of cells.

Nighborhood of moving data

Required Methods

Performs one step of the simulation, creating diffs and movements that go out to neighbors.

Updates a cell with a diff and movements into this cell. Note that these movements are the ones produced in each neighboring cell.

Implementors