rule30
This project efficiently implements Stephen Wolfram's elementary cellular automata (Rule 30 being a notable example), specifically their single 1 histories. Histories can be generated in various matrix formats (including numpy.ndarray
) and exported as strings or images.
Installation
To install from PyPI:
pip install rule30
To install and develop from this repository:
./setup.py develop
API reference
Console script
$ rule30 --help usage: rule30 [-h] [-n ROWS] [-r [RULE]] [-s BLOCK_SIZE] [--version] [--debug] image Generate images for the single 1 histories of Stephen Wolfram's elementary cellular automata. positional arguments: image path to the output image (PNG format) optional arguments: -h, --help show this help message and exit -n ROWS, --rows ROWS number of rows to generate; default is 256 -r [RULE], --rule [RULE] Wolfram code of the rule (between 0 and 255); default is 30 -s BLOCK_SIZE, --block-size BLOCK_SIZE the size in pixels for each cell; default is 1 --version show program's version number and exit --debug enable debug messages
See also
- Elementary Cellular Automaton, Wikipedia;
- Rule 30, Wikipedia;
- Elementary Cellular Automaton, Wolfram MathWorld;
- Cellular Automata, Stanford Encyclopedia of Philosophy;
- The 256 Rules, Stanford Encyclopedia of Philosophy.
Images
Here are the images for some interesting rules with individual pages on Wolfram MathWorld. Images for all 256 rules can be found in the images
directory.
License
Copyright (c) 2017 Zhiming Wang <[email protected]>
This project is licensed under the MIT license. See COPYING
for details.
Images in the images
directory are separately licensed under CC0 1.0 Universal.