Metadata-Version: 2.1
Name: gameoflife-ndimage
Version: 0.1.3
Summary: Quick simulation of arbitrary rulesets for nearest-neighbour cellular automata. Uses scipy.ndimage.correlate, and can export videos via ffmpeg-python.
Home-page: https://github.com/RundownRhino/Cellular-Automata-Simulator
License: MIT
Keywords: gameoflife,cellular,automata,scipy
Author: RundownRhino
Author-email: 52856631+RundownRhino@users.noreply.github.com
Requires-Python: >=3.10,<4.0
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Requires-Dist: ffmpeg-python (>=0.2.0,<0.3.0)
Requires-Dist: numpy (>=1.23.5,<2.0.0)
Requires-Dist: pillow (>=9.3.0,<10.0.0)
Requires-Dist: scipy (>=1.9.3,<2.0.0)
Project-URL: Repository, https://github.com/RundownRhino/Cellular-Automata-Simulator
Description-Content-Type: text/markdown

# Cellular Automata Simulator

Uses `numpy` and `scipy.ndimage` to quickly simulate arbitrary rulesets for nearest-neighbours cellular automata. Can
generate videos and images of the results via `ffmpeg-python` and `pillow`.

### Usage example:

```python
import gameoflife_ndimage.simulation as sim
from gameoflife_ndimage.video import Recorder

if __name__ == '__main__':
    rules = sim.Rules2D.classic()
    size = (256, 256)
    draw_params = sim.DrawParams(dead_color=[0, 0, 0], alive_color=[255, 255, 255], resize_factor=4)

    state = sim.State2D.random(rules, size)
    input_wh = tuple(a * draw_params.resize_factor for a in state.wh)
    recorder = Recorder(
        framerate=5,
        input_wh=input_wh,
        output_path="output/gol_classic_{}x{}_from_random.mp4".format(*size),
    )
    state.run_and_record(100, draw_params, recorder)
    recorder.close()
```
