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

C++20 concepts for the Cellular Automata module. More...

#include <concepts>
#include <cstddef>
#include <tuple>
#include <type_traits>
#include <utility>
#include <ca-traits.H>
Include dependency graph for tpl_ca_concepts.H:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Namespaces

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

Concepts

concept  Aleph::CA::CellState
 A type usable as the value stored inside a cell.
 
concept  Aleph::CA::Coord
 A coordinate type with N integral components.
 
concept  Aleph::CA::LatticeLike
 Storage + topology that carries the cell values.
 
concept  Aleph::CA::NeighborhoodLike
 Connectivity pattern around a coordinate.
 
concept  Aleph::CA::BasicRuleLike
 Pure local transition function (Phase 0–7 signature).
 
concept  Aleph::CA::ContextualRuleLike
 Context-aware local transition function (Phase 8).
 
concept  Aleph::CA::RuleLike
 Local transition function (any supported signature).
 
concept  Aleph::CA::HasRefreshHalo
 Detect whether a lattice exposes a refresh_halo() method (the hallmark of a Ghost_Lattice or any other halo-aware variant).
 
concept  Aleph::CA::HexRenderable
 Detect whether a lattice exposes the hexagonal-grid query interface (rows(), cols(), at_axial(Hex_Axial)) used by the SVG and TikZ hex renderers.
 
concept  Aleph::CA::TriRenderable
 Detect whether a lattice exposes the triangular-grid query interface (rows(), cols(), at_tri(Tri_Coord)) used by the SVG and TikZ triangular renderers.
 

Functions

template<typename Rule , typename State , std::size_t Rank>
State Aleph::CA::apply_rule (const Rule &r, const State &s, Neighbor_View< State > v, const Cell_Context< Rank > &ctx)
 Invoke a rule, optionally forwarding the per-cell context.
 

Detailed Description

C++20 concepts for the Cellular Automata module.

Defines the lightweight constraints used throughout Aleph::CA to validate adapters that build a cellular automaton:

  • CellState<T> — what can live inside a cell.
  • Coord<C, N> — N-dimensional coordinate types.
  • LatticeLike<L> — storage + topology that holds the cells.
  • NeighborhoodLike<H>**— connectivity pattern around a coordinate.
  • **RuleLike<R, L> — local transition function.

The concept names use a Like suffix so that the class templates introduced in later phases (Lattice<Storage, Boundary>, the Moore / Von_Neumann neighborhoods, the rule classes) can keep their natural unsuffixed names without colliding with concepts.

The concepts are intentionally permissive. They describe the minimum API the Cellular Automata engine relies on, so any reasonable user-defined storage/rule pair can be plugged in.

Author
Leandro Rabindranath Leon

Definition in file tpl_ca_concepts.H.