Struct rlifesrc_lib::Config [−][src]
World configuration.
The world will be generated from this configuration.
Fields
width: i32
Width.
height: i32
Height.
period: i32
Period.
dx: i32
Horizontal translation.
dy: i32
Vertical translation.
transform: Transform
Transformations (rotations and reflections) after the last generation in a period.
After the last generation in a period, the pattern will return to
the first generation, applying this transformation first,
and then the translation defined by dx
and dy
.
symmetry: Symmetry
Symmetries of the pattern.
search_order: Option<SearchOrder>
The order to find a new unknown cell.
It will always search all generations of one cell before going to another cell.
None
means that it will automatically choose a search order
according to the width and height of the world.
new_state: NewState
How to choose a state for an unknown cell.
max_cell_count: Option<u32>
The number of minimum living cells in all generations must not exceed this number.
None
means that there is no limit for the cell count.
reduce_max: bool
Whether to automatically reduce the max_cell_count
when a result is found.
The max_cell_count
will be set to the cell count of
the current result minus one.
rule_string: String
The rule string of the cellular automaton.
diagonal_width: Option<i32>
Diagonal width.
If the diagonal width is n
, the cells at position (x, y)
where abs(x - y) >= n
are assumed to be dead.
skip_subperiod: bool
Whether to skip patterns whose fundamental period are smaller than the given period.
skip_subsymmetry: bool
Whether to skip patterns which are invariant under more transformations than required by the given symmetry.
In another word, whether to skip patterns whose symmetry group properly contains the given symmetry group.
known_cells: Vec<KnownCell>
Cells whose states are known before the search.
backjump: bool
(Experimental) Whether to enable backjumping.
Backjumping will reduce the number of steps, but each step will takes a much longer time. The current implementation is slower for most search, only useful for large (e.g., 64x64) still lifes.
Currently it is only supported for non-generations rules. Generations rules will ignore this option.
Implementations
impl Config
[src]
pub fn new(width: i32, height: i32, period: i32) -> Self
[src]
Sets up a new configuration with given size.
pub fn set_translate(self, dx: i32, dy: i32) -> Self
[src]
Sets the translations (dx, dy)
.
pub fn set_transform(self, transform: Transform) -> Self
[src]
Sets the transformation.
pub fn set_symmetry(self, symmetry: Symmetry) -> Self
[src]
Sets the symmetry.
pub fn set_search_order<T: Into<Option<SearchOrder>>>(
self,
search_order: T
) -> Self
[src]
self,
search_order: T
) -> Self
Sets the search order.
pub fn set_new_state(self, new_state: NewState) -> Self
[src]
Sets how to choose a state for an unknown cell.
pub fn set_max_cell_count<T: Into<Option<u32>>>(self, max_cell_count: T) -> Self
[src]
Sets the maximal number of living cells.
pub fn set_reduce_max(self, reduce_max: bool) -> Self
[src]
Sets whether to automatically reduce the max_cell_count
when a result is found.
pub fn set_rule_string<S: ToString>(self, rule_string: S) -> Self
[src]
Sets the rule string.
pub fn set_diagonal_width<T: Into<Option<i32>>>(self, diagonal_width: T) -> Self
[src]
Sets the diagonal width.
pub fn set_skip_subperiod(self, skip_subperiod: bool) -> Self
[src]
Sets whether to skip patterns whose fundamental period is smaller than the given period.
pub fn set_skip_subsymmetry(self, skip_subsymmetry: bool) -> Self
[src]
Sets whether to skip patterns which are invariant under more transformations than required by the given symmetry.
pub fn set_known_cells<T: Into<Vec<KnownCell>>>(self, known_cells: T) -> Self
[src]
Sets cells whose states are known before the search.
pub fn set_backjump(self, backjump: bool) -> Self
[src]
Sets whether to enable backjumping.
pub fn require_square_world(&self) -> bool
[src]
Whether the configuration requires the world to be square.
pub fn require_no_diagonal_width(&self) -> bool
[src]
Whether the configuration requires the world to have no diagonal width.
pub fn world(&self) -> Result<Box<dyn Search>, Error>
[src]
Creates a new world from the configuration. Returns an error if the rule string is invalid.
Trait Implementations
impl Clone for Config
[src]
impl Debug for Config
[src]
impl Default for Config
[src]
impl<'de> Deserialize<'de> for Config
[src]
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error> where
__D: Deserializer<'de>,
[src]
__D: Deserializer<'de>,
impl Eq for Config
[src]
impl Hash for Config
[src]
fn hash<__H: Hasher>(&self, state: &mut __H)
[src]
pub fn hash_slice<H>(data: &[Self], state: &mut H) where
H: Hasher,
1.3.0[src]
H: Hasher,
impl PartialEq<Config> for Config
[src]
impl Serialize for Config
[src]
fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error> where
__S: Serializer,
[src]
__S: Serializer,
impl StructuralEq for Config
[src]
impl StructuralPartialEq for Config
[src]
Auto Trait Implementations
impl RefUnwindSafe for Config
[src]
impl Send for Config
[src]
impl Sync for Config
[src]
impl Unpin for Config
[src]
impl UnwindSafe for Config
[src]
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> DeserializeOwned for T where
T: for<'de> Deserialize<'de>,
[src]
T: for<'de> Deserialize<'de>,
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
pub fn to_owned(&self) -> T
[src]
pub fn clone_into(&self, target: &mut T)
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
pub fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
V: MultiLane<T>,