Struct gridsim::Grid
[−]
[src]
pub struct Grid<S: Sim> { /* fields omitted */ }
Represents the state of the simulation.
This is not as efficient for Rule and is optimized for Sim.
Methods
impl<S: Sim> Grid<S>[src]
fn new(width: usize, height: usize) -> Grid<S> where
S::Cell: Default, [src]
S::Cell: Default,
Make a new grid using the Cell's Default impl.
fn new_default(width: usize, height: usize, default: S::Cell) -> Grid<S> where
S::Cell: Clone, [src]
S::Cell: Clone,
Make a new grid by cloning a default Cell.
fn new_iter<I>(width: usize, height: usize, iter: I) -> Grid<S> where
I: IntoIterator<Item = S::Cell>, [src]
I: IntoIterator<Item = S::Cell>,
Make a new grid directly from an initial iter.
fn cycle(&mut self)[src]
Run the Grid for one cycle.
fn get_cells(&self) -> &[S::Cell][src]
Get the Grid's Cell slice.
fn get_cells_mut(&mut self) -> &mut [S::Cell][src]
Get the Grid's Cell slice mutably.
fn size(&self) -> usize[src]
Get the Grid's size.