|
Aleph-w 3.0
A C++ Library for Data Structures and Algorithms
|
Phase 13 example: Toffoli & Margolus' Critters reversible CA. More...
#include <cstddef>#include <cstdint>#include <cstdlib>#include <iostream>#include <limits>#include <random>#include <stdexcept>#include <string>#include <ca-traits.H>#include <tpl_ca_async_engine.H>#include <tpl_ca_block_rule.H>#include <tpl_ca_lattice.H>#include <tpl_ca_storage.H>#include <tpl_ca_update_scheme.H>Go to the source code of this file.
Functions | |
| int | main (int argc, char **argv) |
Phase 13 example: Toffoli & Margolus' Critters reversible CA.
Critters is the canonical Margolus block-rule CA. The 2×2 partition alternates origin between (0,0) and (1,1) on consecutive steps, and the rule is its own inverse: applying it twice to the same block is the identity. Combined with the alternating partition, the CA is fully reversible.
The example runs the rule N steps forward, prints the final frame, runs it N steps backward, and verifies that the recovered frame is bit-identical to the initial random soup.
Run: ./ca_critters_reversible_example [steps] [side] [seed]
Definition in file ca_critters_reversible_example.cc.
| int main | ( | int | argc, |
| char ** | argv | ||
| ) |
Definition at line 99 of file ca_critters_reversible_example.cc.
References Aleph::blossom_maximum_cardinality_matching(), engine, seed, and steps.