|
Aleph-w 3.0
A C++ Library for Data Structures and Algorithms
|
Pick one cell at random per sub-step, update it in place. More...
#include <tpl_ca_update_scheme.H>
Public Member Functions | |
| constexpr | Random_Asynchronous_Update (const std::uint64_t seed=0, const std::size_t sub_steps=0) noexcept |
| Build a random asynchronous update strategy. | |
| template<typename Engine , typename Rule > | |
| void | apply (Engine &e, Rule &r) const |
| Execute one randomised step. | |
Public Attributes | |
| std::uint64_t | master_seed = 0 |
| std::size_t | sub_steps_per_step = 0 |
Number of single-cell sub-steps per step(). | |
Static Public Attributes | |
| static constexpr bool | requires_double_buffer = false |
| In-place updates → no second buffer. | |
| static constexpr bool | requires_block_rule = false |
| Operates on cell rules. | |
Pick one cell at random per sub-step, update it in place.
A step() performs sub_steps_per_step sub-steps; each sub-step picks a single cell uniformly at random (using the master seed, the engine step count and the sub-step index to derive a stable per-(step, sub) draw) and applies the rule in place.
Both the cell selection and any per-cell randomness in the rule derive from the same master seed but use disjoint sub-streams, so changing sub_steps_per_step reshuffles the visit pattern but keeps every other dimension reproducible.
| Engine_Type | PRNG used for cell selection. Defaults to std::mt19937_64 for its 64-bit output and good quality. |
Definition at line 372 of file tpl_ca_update_scheme.H.
|
inlineconstexprnoexcept |
Build a random asynchronous update strategy.
| [in] | seed | master seed forwarded to cell_seed. |
| [in] | sub_steps | number of sub-steps per engine step (0 → one full sweep per step). |
| This | constructor does not throw. |
Definition at line 391 of file tpl_ca_update_scheme.H.
|
inline |
Execute one randomised step.
| Engine | engine type. |
| Rule | cell rule satisfying RuleLike<Rule, Lattice>. |
| [in,out] | e | engine reference. |
| [in] | r | rule reference. |
| Any | exception propagated by the rule, the lattice or the PRNG construction. |
Definition at line 406 of file tpl_ca_update_scheme.H.
References Aleph::CA::apply_rule(), Aleph::blossom_maximum_cardinality_matching(), Aleph::CA::ca_scheme_detail::cell_count(), Aleph::CA::gather_neighbors(), Aleph::CA::Random_Asynchronous_Update< Engine_Type >::master_seed, Aleph::CA::mix_seed(), Aleph::next(), r, and Aleph::CA::Random_Asynchronous_Update< Engine_Type >::sub_steps_per_step.
| std::uint64_t Aleph::CA::Random_Asynchronous_Update< Engine_Type >::master_seed = 0 |
Definition at line 379 of file tpl_ca_update_scheme.H.
Referenced by Aleph::CA::Random_Asynchronous_Update< Engine_Type >::apply().
|
staticconstexpr |
Operates on cell rules.
Definition at line 377 of file tpl_ca_update_scheme.H.
|
staticconstexpr |
In-place updates → no second buffer.
Definition at line 375 of file tpl_ca_update_scheme.H.
| std::size_t Aleph::CA::Random_Asynchronous_Update< Engine_Type >::sub_steps_per_step = 0 |
Number of single-cell sub-steps per step().
0 means "as many sub-steps as there are cells in the lattice".
Definition at line 382 of file tpl_ca_update_scheme.H.
Referenced by Aleph::CA::Random_Asynchronous_Update< Engine_Type >::apply().