Struct cellular_automaton::Automaton [−][src]
pub struct Automaton { /* fields omitted */ }Expand description
A two-dimensional cellular automaton with a finite grid of cells.
Implementations
Resizes the automaton so that cols is equal to width.
If width is greater than cols, the automaton’s rows are extended by the
difference, with each additional column filled with 0. If width is less
than cols, the automaton’s rows are simply truncated.
Examples
todo!();Resizes the automaton so that rows is equal to height.
If height is greater than rows, the automaton’s columns are extended by
the difference, with each additional row filled with 0. If height is less
than rows, the automaton’s columns are simply truncated.
Examples
todo!();Toggles the state of a cell. If the cell state is 0, it is set to 1. If the cell is any other state, it is set to 0.
Examples
todo!();Sets the state of cells in locations to 1.
locations is a list of alternating row and column coordinates. This
function is implemented with an array as the parameter because
wasm_bindgen does not support nested arrays.
Examples
todo!();Sets the cell state of all the automaton’s cells to n.
Only changes the automaton if n is less than or equal to the generation
rule.
Examples
todo!();Randomizes the cell state of all the automaton’s cells.
Loops through the automaton’s cells and if rand::random() is less than the
percentage n, the cell state is set to 1.
Examples
todo!();Trait Implementations
This method returns an ordering between self and other values if one exists. Read more
This method tests less than (for self and other) and is used by the < operator. Read more
This method tests less than or equal to (for self and other) and is used by the <=
operator. Read more
This method tests greater than (for self and other) and is used by the > operator. Read more
The type that holds the reference to Self for the duration of the
invocation of the function that has an &Self parameter. This is
required to ensure that the lifetimes don’t persist beyond one function
call, and so that they remain anonymous. Read more
Recover a Self::Anchor from Self::Abi. Read more
Auto Trait Implementations
impl RefUnwindSafe for Automaton
impl UnwindSafe for Automaton
Blanket Implementations
Mutably borrows from an owned value. Read more
type Abi = <T as IntoWasmAbi>::Abi
type Abi = <T as IntoWasmAbi>::Abi
Same as IntoWasmAbi::Abi
Same as IntoWasmAbi::into_abi, except that it may throw and never
return in the case of Err. Read more