55struct Spread_Once_Functor
57 template <
typename State>
58 [[
nodiscard]]
constexpr State operator()(
const State ¤t,
59 const std::size_t alive)
const noexcept
61 return (current != State{}
or alive >= 1) ?
static_cast<State
>(1)
62 :
static_cast<State
>(0);
70 std::size_t alive = 0;
73 if (
lat.at_tri(
Tri_Coord{static_cast<ca_index_t>(i), static_cast<ca_index_t>(j)})
76 std::printf(
"\nStep %2zu alive=%zu\n", step, alive);
85 std::printf(
"%c ", glyph);
101 "Aleph::CA Phase-6 example: triangular spread-once on an 8x8 lattice\n");
107 for (std::size_t s = 1; s <= 6; ++s)
113 std::printf(
"\n--- TikZ render of step 6 ---\n");
116 [](
int v) { return v != 0 ?
"blue" :
"white"; },
Rule whose next state depends on (current, alive_count).
Synchronous double-buffered engine.
void step()
Apply the rule to every cell once and swap buffers.
Triangular lattice with parity helpers over a 2D storage.
Three edge-neighbours over a 2D lattice with parity coupling.
size_t blossom_maximum_cardinality_matching(const GT &g, DynDlist< typename GT::Arc * > &matching, SA sa=SA())
Alias of compute_maximum_cardinality_general_matching().
std::ptrdiff_t ca_index_t
Signed coordinate component used by lattices and neighborhoods.
constexpr bool tri_is_up(const Tri_Coord &c) noexcept
std::size_t ca_size_t
Unsigned size component used for extents and counts.
void render_triangular_lattice_tikz(std::ostream &os, const Lattice &lat, Palette &&palette, const double side=1.0)
Render a triangular frame as a TikZ picture.
Main namespace for Aleph-w library functions.
void print(const DynList< Parc< Net > > &sp)
Print a semi-path to stdout.
Out-of-range neighbours behave as if the lattice ended.
Coordinates of a triangular cell as (i, j) integers.
Synchronous double-buffered engine for cellular automata.
Neighborhoods catalogue for Aleph::CA.
Rule mechanisms for Aleph::CA.
Dense, contiguous storage for cellular automata cells (1D/2D/3D).
Triangular lattice with up/down parity helpers and pixel mapping suitable for visualisation.