pub struct CellularAutomaton { /* private fields */ }Expand description
Cellular automaton
Implementations§
Source§impl CellularAutomaton
impl CellularAutomaton
Sourcepub fn one_dimensional(name: &str, rule: u8, size: usize) -> Self
pub fn one_dimensional(name: &str, rule: u8, size: usize) -> Self
Create a new 1D cellular automaton
Sourcepub fn game_of_life(name: &str, width: usize, height: usize) -> Self
pub fn game_of_life(name: &str, width: usize, height: usize) -> Self
Create a new Game of Life
Sourcepub fn with_output_mode(self, mode: OutputMode) -> Self
pub fn with_output_mode(self, mode: OutputMode) -> Self
Set the output mode
Sourcepub fn with_range(self, range: Range) -> Self
pub fn with_range(self, range: Range) -> Self
Set the range
Trait Implementations§
Source§impl Automaton for CellularAutomaton
impl Automaton for CellularAutomaton
Source§type State = CellularState
type State = CellularState
State type.
Source§fn step(
&self,
_time: Time,
_action: &Self::Action,
state: &Self::State,
) -> (Self::State, Option<f64>)
fn step( &self, _time: Time, _action: &Self::Action, state: &Self::State, ) -> (Self::State, Option<f64>)
Advance the automaton by one time step. Read more
Source§fn initial_state(&self) -> Self::State
fn initial_state(&self) -> Self::State
Return the initial state.
Source§fn extract_value(&self, state: &Self::State) -> f64
fn extract_value(&self, state: &Self::State) -> f64
Extract the output value from the state.
Source§impl Clone for CellularAutomaton
impl Clone for CellularAutomaton
Source§fn clone(&self) -> CellularAutomaton
fn clone(&self) -> CellularAutomaton
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for CellularAutomaton
impl RefUnwindSafe for CellularAutomaton
impl Send for CellularAutomaton
impl Sync for CellularAutomaton
impl Unpin for CellularAutomaton
impl UnsafeUnpin for CellularAutomaton
impl UnwindSafe for CellularAutomaton
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more