|
Aleph-w 3.0
A C++ Library for Data Structures and Algorithms
|
Rule whose next state depends on (current, alive_count).
More...
#include <tpl_ca_rule.H>
Public Member Functions | |
| constexpr | Outer_Totalistic_Rule (F func) |
| Construct an outer-totalistic rule from a functor. | |
| template<typename State > | |
| constexpr State | operator() (const State ¤t, Neighbor_View< State > neighbours) const |
| Compute the next state from current value and neighbours. | |
Private Attributes | |
| F | f_ |
Rule whose next state depends on (current, alive_count).
"Alive" is defined as any non-zero neighbour value (so this rule works equally well for bool and small integral state types). The wrapped functor F receives the current state and the number of non-zero neighbours, and returns the next state.
| F | functor type with signature (State, std::size_t) -> State. |
Definition at line 98 of file tpl_ca_rule.H.
|
inlineexplicitconstexpr |
Construct an outer-totalistic rule from a functor.
| [in] | func | callable object receiving (State current, std::size_t alive). |
| Any | exception thrown while moving/copying func. |
Definition at line 109 of file tpl_ca_rule.H.
|
inlineconstexpr |
Compute the next state from current value and neighbours.
| State | cell state type. |
| [in] | current | current centre-cell state. |
| [in] | neighbours | read-only neighbour values. |
| Any | exception thrown by the wrapped functor. |
Definition at line 120 of file tpl_ca_rule.H.
References Aleph::CA::Outer_Totalistic_Rule< F >::f_.
|
private |
Definition at line 100 of file tpl_ca_rule.H.
Referenced by Aleph::CA::Outer_Totalistic_Rule< F >::operator()().