[][src]Trait rlifesrc_lib::Search

pub trait Search {
    fn search(&mut self, max_step: Option<u64>) -> Status;
fn display_gen(&self, t: isize) -> String;
fn config(&self) -> Config;
fn cell_count_gen(&self, t: isize) -> usize;
fn cell_count(&self) -> usize;
fn conflicts(&self) -> u64;
fn set_max_cell_count(&mut self, max_cell_count: Option<usize>); }

A trait for World.

So that we can switch between different rule types using trait objects.

Required methods

fn search(&mut self, max_step: Option<u64>) -> Status

The search function.

Returns Found if a result is found, None if such pattern does not exist, Searching if the number of steps exceeds max_step and no results are found.

fn display_gen(&self, t: isize) -> String

Displays the whole world in some generation.

  • Dead cells are represented by .;
  • Living cells are represented by O;
  • Unknown cells are represented by ?.

fn config(&self) -> Config

World configuration.

fn cell_count_gen(&self, t: isize) -> usize

Number of known living cells in some generation.

fn cell_count(&self) -> usize

Minumum number of known living cells in all generation.

fn conflicts(&self) -> u64

Number of conflicts during the search.

fn set_max_cell_count(&mut self, max_cell_count: Option<usize>)

Set the max cell counts.

Currently this is the only parameter that you can change during the search.

Loading content...

Implementors

The Search trait is implemented for every World.

Loading content...