31#ifndef ALEPH_REPRODUCTIONS_SOURCE_DIR
32# define ALEPH_REPRODUCTIONS_SOURCE_DIR "reproductions"
38 constexpr std::size_t
steps = 4000;
39 constexpr std::uint64_t
seed = 0x5eed1234abcddcbaull;
43 std::cerr <<
"Usage: gray_scott_patterns [--update-golden]\n";
52 std::filesystem::create_directories(
root /
"results");
53 std::ofstream
summary(
root /
"results" /
"gray_scott_summary.csv");
56 std::cerr <<
"Cannot write Gray-Scott summary\n";
59 summary <<
"preset,side,steps,mean_channel_difference\n";
65 const std::filesystem::path reference =
reference_dir / (std::string(
preset.name) +
".png");
69 std::filesystem::copy_file(
generated, reference,
70 std::filesystem::copy_options::overwrite_existing);
71 std::cout <<
"Updated " << reference <<
'\n';
75 const double difference
78 << std::setprecision(12) << difference <<
'\n';
79 std::cout <<
"Gray-Scott " <<
preset.name <<
": mean channel difference="
80 << std::fixed << std::setprecision(6) << difference <<
'\n';
81 if (difference >= 0.01)
83 std::cerr <<
"Gray-Scott " <<
preset.name <<
" differs from golden by at least 1%\n";
Internal helpers shared by the cellular-automata reproductions.
Lattice that adds boundary-aware access on top of a storage.
__gmp_expr< T, __gmp_binary_expr< __gmp_expr< T, U >, unsigned long int, __gmp_root_function > > root(const __gmp_expr< T, U > &expr, unsigned long int l)
#define ALEPH_REPRODUCTIONS_SOURCE_DIR
size_t blossom_maximum_cardinality_matching(const GT &g, DynDlist< typename GT::Arc * > &matching, SA sa=SA())
Alias of compute_maximum_cardinality_general_matching().
constexpr std::array< Gray_Scott_Preset, 3 > gray_scott_presets
Canonical visual presets used by the weekly Gray-Scott reproduction.
Gray_Scott_Lattice run_gray_scott(const Gray_Scott_Preset &preset, const ca_size_t side, const std::size_t steps, const std::uint64_t master_seed)
Run one Gray-Scott preset from the shared deterministic seed.
double mean_channel_difference(const Native_Png &lhs, const Native_Png &rhs)
Compute normalized mean absolute per-channel PNG difference.
void write_gray_scott_png(const std::filesystem::path &path, const Gray_Scott_Lattice &frame)
Write a Gray-Scott frame as a native Aleph RGB PNG.
Native_Png read_native_png(const std::filesystem::path &path)
Read and decode a native Aleph PNG.
std::size_t ca_size_t
Unsigned size component used for extents and counts.
and
Check uniqueness with explicit hash + equality functors.
One named Gray-Scott parameter preset.