71 for (std::size_t i = 0; i < n; ++i)
72 for (std::size_t j = 0; j < n; ++j)
73 lat.set({static_cast<ca_index_t>(i), static_cast<ca_index_t>(j)},
82 std::printf(
"Aleph::CA Phase-7 example: full observability pipeline\n");
83 std::printf(
"------------------------------------------------------\n");
103 std::printf(
"\nRandom GoL 64x64, 200 steps\n");
104 std::printf(
" density samples : %zu\n",
dens.size());
105 std::printf(
" activity samples : %zu\n",
act.size());
106 std::printf(
" entropy samples : %zu\n",
ent.size());
107 std::printf(
" snapshot count : %zu\n",
samp.size());
108 std::printf(
" density (initial) : %.4f\n",
dens.density_at(0));
109 std::printf(
" density (final) : %.4f\n",
113 for (std::size_t i =
dens.size() - 50; i <
dens.size(); ++i)
116 std::printf(
" density (last-50 avg) : %.4f\n",
avg_density);
121 for (
auto a :
act.activity())
122 avg_act +=
static_cast<double>(a);
124 std::printf(
" activity (avg) : %.2f cells/step\n",
avg_act);
127 std::printf(
" entropy (final) : %.4f nats\n",
128 ent.entropy().get_last());
129 if (
det.cycle_detected())
130 std::printf(
" short cycle detected : length=%zu starting at step=%zu\n",
131 *
det.cycle_length(), *
det.cycle_start());
133 std::printf(
" short cycle detected : none within window=%zu\n",
134 det.buffered_hashes());
151 std::printf(
"\nBlinker reference run (8 steps)\n");
152 std::printf(
" activity per step :");
153 for (
auto a :
b_act.activity())
154 std::printf(
" %zu", a);
156 std::printf(
" cycle length : %zu\n",
157 b_det.cycle_detected() ? *
b_det.cycle_length() : 0);
Convenience builders for the Phase 3 synchronous engine.
Free metric helpers for cellular automata frames.
Phase-7 observability layer for cellular automata engines.
Common typedefs and tag types for the Cellular Automata module.
Records the number of cells that changed across each step.
Variadic adaptor that fan-outs notifications to many observers.
Records the count of cells in tracked_state per step.
Records the Shannon entropy of the state distribution.
Lattice that adds boundary-aware access on top of a storage.
Moore (Chebyshev) neighborhood of radius R in N dimensions.
Snapshots the lattice every period steps.
Detects fixed points and short cycles via frame hashing.
Synchronous double-buffered engine.
size_t blossom_maximum_cardinality_matching(const GT &g, DynDlist< typename GT::Arc * > &matching, SA sa=SA())
Alias of compute_maximum_cardinality_general_matching().
void attach_observer(Engine &engine, Observer &observer)
Plug an observer into an engine's pre/post-step hooks.
constexpr Game_Of_Life_Rule make_game_of_life_rule() noexcept
Build the canonical Game of Life rule.
double density(const Lattice &lat, const typename Lattice::state_type &s)
Main namespace for Aleph-w library functions.
The lattice wraps around on every axis.
Synchronous double-buffered engine for cellular automata.
Cellular automata lattice with pluggable boundary policies.
Neighborhoods catalogue for Aleph::CA.
Rule mechanisms for Aleph::CA.
Dense, contiguous storage for cellular automata cells (1D/2D/3D).