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

Internal helpers shared by the cellular-automata reproductions. More...

#include <algorithm>
#include <array>
#include <cmath>
#include <cstddef>
#include <cstdint>
#include <filesystem>
#include <fstream>
#include <istream>
#include <iterator>
#include <map>
#include <ostream>
#include <random>
#include <string>
#include <utility>
#include <vector>
#include <ah-errors.H>
#include <ca-png.H>
#include <ca-rng.H>
#include <ca-traits.H>
#include <tpl_ca_continuous_rules.H>
#include <tpl_ca_engine.H>
#include <tpl_ca_lattice.H>
#include <tpl_ca_neighborhood.H>
#include <tpl_ca_storage.H>
#include <tpl_ca_update_scheme.H>
Include dependency graph for ca_reproduction_support.H:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  Aleph::CA::Reproductions::Linear_Fit
 Least-squares result for a log-log histogram. More...
 
struct  Aleph::CA::Reproductions::Avalanche
 Avalanche measurements for one BTW grain drop. More...
 
class  Aleph::CA::Reproductions::BTW_Sandpile
 Deterministic open-boundary Bak-Tang-Wiesenfeld sandpile. More...
 
struct  Aleph::CA::Reproductions::Gray_Scott_Preset
 One named Gray-Scott parameter preset. More...
 
struct  Aleph::CA::Reproductions::Native_Png
 Decoded subset of the dependency-free native PNG format. More...
 

Namespaces

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

Typedefs

using Aleph::CA::Reproductions::Gray_Scott_Cell = Reaction_Diffusion_Cell< double >
 
using Aleph::CA::Reproductions::Gray_Scott_Lattice = Lattice< Dense_Cell_Storage< Gray_Scott_Cell, 2 >, NeumannBoundary >
 

Functions

Linear_Fit Aleph::CA::Reproductions::fit_log_log_histogram (const std::vector< std::size_t > &samples, const std::size_t min_value, const std::size_t max_value, const std::size_t bins, const double sample_weight_power=0.0)
 Fit a power-law exponent from logarithmically binned samples.
 
void Aleph::CA::Reproductions::write_histogram_csv (const std::filesystem::path &path, const std::vector< std::size_t > &samples)
 Write an exact discrete histogram as CSV.
 
template<typename Lattice >
double Aleph::CA::Reproductions::morans_i_binary (const Lattice &frame, const typename Lattice::state_type empty_state, const typename Lattice::state_type type_a, const typename Lattice::state_type type_b)
 Compute Moran's I for two occupied Schelling cell types.
 
Gray_Scott_Lattice Aleph::CA::Reproductions::make_gray_scott_seed (const ca_size_t side, const std::uint64_t master_seed)
 Build the deterministic finite-amplitude Gray-Scott perturbation.
 
Gray_Scott_Lattice Aleph::CA::Reproductions::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.
 
RGB8 Aleph::CA::Reproductions::gray_scott_rgb (const Gray_Scott_Cell &cell)
 Convert one Gray-Scott state to an RGB colour.
 
void Aleph::CA::Reproductions::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 Aleph::CA::Reproductions::decode_native_png (std::istream &in)
 Decode a PNG emitted by Aleph::CA::write_png.
 
Native_Png Aleph::CA::Reproductions::read_native_png (const std::filesystem::path &path)
 Read and decode a native Aleph PNG.
 
double Aleph::CA::Reproductions::mean_channel_difference (const Native_Png &lhs, const Native_Png &rhs)
 Compute normalized mean absolute per-channel PNG difference.
 
template<typename F >
void Aleph::CA::Reproductions::for_each_gosper_gun_cell (F &&visitor, const std::int64_t offset_x=0, const std::int64_t offset_y=0)
 Visit every live coordinate in the canonical Gosper gun.
 

Variables

constexpr std::array< Gray_Scott_Preset, 3 > Aleph::CA::Reproductions::gray_scott_presets
 Canonical visual presets used by the weekly Gray-Scott reproduction.
 
constexpr std::array< std::array< std::int64_t, 2 >, 36 > Aleph::CA::Reproductions::gosper_gun_cells
 Canonical 36-cell Gosper glider gun.
 

Detailed Description

Internal helpers shared by the cellular-automata reproductions.

This header is intentionally local to reproductions/: it is scientific tooling, not part of the installed Aleph API. The helpers keep the weekly reproductions and their reduced smoke tests on the same code paths.

Definition in file ca_reproduction_support.H.