50 const unsigned long value = std::strtoul(text, &end, 10);
51 if (end == text
or *end !=
'\0' or value == 0
52 or value > std::numeric_limits<std::size_t>::max())
54 return static_cast<std::size_t
>(
value);
60 return static_cast<double>(
h >> 11) * (1.0 / 9007199254740992.0) - 0.5;
65 constexpr std::uint64_t
seed = 0x5eed1234abcddcbaull;
80 lat.set(coord, Cell{0.50 + z, 0.25 - z});
84std::uint8_t byte(
const double value)
86 const double x = std::clamp(
value, 0.0, 1.0);
87 return static_cast<std::uint8_t
>(255.0 * x + 0.5);
90struct Gray_Scott_Colour
95 byte(1.35 * (1.0 -
cell.u)),
96 byte(0.25 + 1.7 * (
cell.u -
cell.v))};
103 const std::string
output =
argc >= 2 ?
argv[1] :
"gray_scott.html";
118 opts.
title =
"Gray-Scott reaction diffusion";
120 opts.cell_size = n <= 80 ? 7 : 4;
123 const std::size_t stride = std::max<std::size_t>(1,
steps / 48);
124 for (std::size_t step = 0; step <=
steps; ++step)
126 if (step % stride == 0)
133 std::cout <<
"Wrote " <<
html.size() <<
" Gray-Scott frames to " <<
output <<
'\n';
static int cell(const aleph_ca_engine_t *e, size_t r, size_t c)
size_t size_t int32_t value
Self-contained HTML trajectory player for CA frames.
Fixed 2-D convolution kernels for continuous cellular automata.
Reproducible random-number support for stochastic CA rules (Phase 8).
Gray-Scott reaction-diffusion rule.
Sink that writes a self-contained HTML playback file.
Lattice that adds boundary-aware access on top of a storage.
Moore (Chebyshev) neighborhood of radius R in N dimensions.
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().
std::ptrdiff_t ca_index_t
Signed coordinate component used by lattices and neighborhoods.
std::array< ca_index_t, N > Coord_Vec
Default coordinate vector.
std::size_t ca_size_t
Unsigned size component used for extents and counts.
Options for generated HTML players.
std::string title
document title
Zero-gradient (Neumann) boundary.
RGB byte triplet used by PPM exporters.
Two-field state for reaction-diffusion cellular automata.
Continuous and memory-bearing CA rules (Phase 9).
Synchronous double-buffered engine for cellular automata.
Cellular automata lattice with pluggable boundary policies.
Neighborhoods catalogue for Aleph::CA.
Dense, contiguous storage for cellular automata cells (1D/2D/3D).