|
Aleph-w 3.0
A C++ Library for Data Structures and Algorithms
|
Outer-totalistic binary rule encoded as two 9-bit bitmasks. More...
#include <tpl_ca_hashlife.H>
Public Member Functions | |
| constexpr bool | apply (const bool current, const std::uint8_t n) const noexcept |
True iff a cell with current state and n live neighbours is alive next. | |
| constexpr bool | operator== (const Outer_Totalistic_Binary_Rule &) const noexcept=default |
Public Attributes | |
| std::uint16_t | birth_mask |
bit i ⇒ dead cell with i live neighbours becomes alive | |
| std::uint16_t | survival_mask |
bit i ⇒ live cell with i live neighbours stays alive | |
Outer-totalistic binary rule encoded as two 9-bit bitmasks.
Bit i (0 ≤ i ≤ 8) of birth_mask is set iff a dead cell with i live Moore-radius-1 neighbours becomes alive in the next generation. Bit i of survival_mask is set iff a live cell with i live neighbours stays alive.
Pre-defined instances:
Conway_Life — B3/S23.HighLife — B36/S23.Day_And_Night — B3678/S34678.Seeds — B2/S (no survival). Definition at line 107 of file tpl_ca_hashlife.H.
|
inlineconstexprnoexcept |
True iff a cell with current state and n live neighbours is alive next.
Definition at line 113 of file tpl_ca_hashlife.H.
References birth_mask, and survival_mask.
Referenced by Aleph::CA::Hashlife_Engine::evolve_level_2().
|
constexprdefaultnoexcept |
| std::uint16_t Aleph::CA::Outer_Totalistic_Binary_Rule::birth_mask |
bit i ⇒ dead cell with i live neighbours becomes alive
Definition at line 109 of file tpl_ca_hashlife.H.
Referenced by apply().
| std::uint16_t Aleph::CA::Outer_Totalistic_Binary_Rule::survival_mask |
bit i ⇒ live cell with i live neighbours stays alive
Definition at line 110 of file tpl_ca_hashlife.H.
Referenced by apply().