Aleph-w 3.0
A C++ Library for Data Structures and Algorithms
Loading...
Searching...
No Matches
tpl_ca_async_engine.H File Reference

Phase 13 update-scheme aware engine. More...

#include <cstddef>
#include <functional>
#include <type_traits>
#include <utility>
#include <ah-errors.H>
#include <ca-traits.H>
#include <tpl_ca_concepts.H>
#include <tpl_ca_neighborhood.H>
#include <tpl_ca_update_scheme.H>
Include dependency graph for tpl_ca_async_engine.H:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

class  Aleph::CA::Null_Neighborhood< Rank >
 Placeholder neighbourhood for engines that drive block rules. More...
 
class  Aleph::CA::Async_Engine< Lattice, Rule, Neighborhood, Update_Scheme >
 Update-scheme aware engine. More...
 

Namespaces

namespace  Aleph
 Main namespace for Aleph-w library functions.
 
namespace  Aleph::CA
 
namespace  Aleph::CA::ca_async_engine_detail
 

Concepts

concept  Aleph::CA::ca_async_engine_detail::HasApplyWithOrigin
 Detect whether the scheme exposes apply_with_origin(engine, rule, origin) (Margolus).
 

Detailed Description

Phase 13 update-scheme aware engine.

Async_Engine<Lattice, Rule, Neighborhood, Update_Scheme> is the Phase 13 generic engine: it owns one (or, when the scheme requires it, two) lattice buffers and dispatches each step() to the chosen update scheme strategy. The scheme controls the visit order, the in-place vs double-buffer write strategy, and (for Margolus) the block-rule semantics.

The engine itself is intentionally minimal: it owns state, exposes the buffers and the neighborhood, and forwards step() to the scheme. All variation lives in the strategies of tpl_ca_update_scheme.H. This is the "ortogonal" design called for in Phase 13: combine any Lattice × Rule × Update_Scheme without spawning a new engine per scheme.

Design constraints:

  • Memory: when Update_Scheme::requires_double_buffer == false (Sequential, Random_Asynchronous, Margolus) only the current lattice is allocated; the next-buffer member stays empty, saving roughly 50% of the storage compared to Synchronous_Engine.
  • Hooks: on_pre_step / on_post_step mirror the synchronous engine API.
  • Margolus: step_back() reverses the most recent step. For an involution Block_Rule the composition forward(N) ∘ backward(N) is the bit-exact identity.

Block-rule schemes (those with requires_block_rule == true) ignore the Neighborhood template parameter; pass Null_Neighborhood<Rank> in that case.

Author
Leandro Rabindranath Leon

Definition in file tpl_ca_async_engine.H.