Aleph-w 3.0
A C++ Library for Data Structures and Algorithms
Loading...
Searching...
No Matches
Aleph::CA::Random_Asynchronous_Update< Engine_Type > Struct Template Reference

Pick one cell at random per sub-step, update it in place. More...

#include <tpl_ca_update_scheme.H>

Collaboration diagram for Aleph::CA::Random_Asynchronous_Update< Engine_Type >:
[legend]

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.
 

Detailed Description

template<typename Engine_Type = std::mt19937_64>
struct Aleph::CA::Random_Asynchronous_Update< Engine_Type >

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.

Template Parameters
Engine_TypePRNG 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.

Constructor & Destructor Documentation

◆ Random_Asynchronous_Update()

template<typename Engine_Type = std::mt19937_64>
constexpr Aleph::CA::Random_Asynchronous_Update< Engine_Type >::Random_Asynchronous_Update ( const std::uint64_t  seed = 0,
const std::size_t  sub_steps = 0 
)
inlineconstexprnoexcept

Build a random asynchronous update strategy.

Parameters
[in]seedmaster seed forwarded to cell_seed.
[in]sub_stepsnumber of sub-steps per engine step (0 → one full sweep per step).
Exceptions
Thisconstructor does not throw.

Definition at line 391 of file tpl_ca_update_scheme.H.

Member Function Documentation

◆ apply()

template<typename Engine_Type = std::mt19937_64>
template<typename Engine , typename Rule >
void Aleph::CA::Random_Asynchronous_Update< Engine_Type >::apply ( Engine &  e,
Rule &  r 
) const
inline

Execute one randomised step.

Template Parameters
Engineengine type.
Rulecell rule satisfying RuleLike<Rule, Lattice>.
Parameters
[in,out]eengine reference.
[in]rrule reference.
Exceptions
Anyexception 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.

Member Data Documentation

◆ master_seed

template<typename Engine_Type = std::mt19937_64>
std::uint64_t Aleph::CA::Random_Asynchronous_Update< Engine_Type >::master_seed = 0

◆ requires_block_rule

template<typename Engine_Type = std::mt19937_64>
constexpr bool Aleph::CA::Random_Asynchronous_Update< Engine_Type >::requires_block_rule = false
staticconstexpr

Operates on cell rules.

Definition at line 377 of file tpl_ca_update_scheme.H.

◆ requires_double_buffer

template<typename Engine_Type = std::mt19937_64>
constexpr bool Aleph::CA::Random_Asynchronous_Update< Engine_Type >::requires_double_buffer = false
staticconstexpr

In-place updates → no second buffer.

Definition at line 375 of file tpl_ca_update_scheme.H.

◆ sub_steps_per_step

template<typename Engine_Type = std::mt19937_64>
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().


The documentation for this struct was generated from the following file: