Metadata-Version: 2.3
Name: pyscail
Version: 0.1.0
Summary: A package that helps build cellular automata
Project-URL: Homepage, https://github.com/ribhuhooja/pyscail
Project-URL: Issues, https://github.com/ribhuhooja/pyscail/issues
Author-email: Ribhu Hooja <ribhu.hooja.27@dartmouth.edu>
License-File: LICENSE
Keywords: cellular automata,game of life
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python :: 3
Requires-Python: >=3.11
Requires-Dist: pygame
Description-Content-Type: text/markdown

# pyscail

**pyscail** is a package for creating cellular automata. It allows you to specify the
allowed states, and the transitions between them, and does everything else for you

![rock-paper-scissors gif](media/rps-gif.gif)

## Installation

You need to have python (>= 3.11) installed on your system. Once you have that,
you can:

```bash
pip install pyscail
```

(or `pip3`, depending on your system)

The project's link on PyPI: https://pypi.org/project/pyscail/

## Usage
See this video for a demonstration of how to use the library: 
https://youtu.be/BjPNs30i2TQ

A brief summary - provide a class with a `next` method and a 
`display` method. Provide a initialization function that returns
an instance of your class given some coordinates. Provide a settings
object that you can make using method provided by the library.
Optionally, provide a function that will be called once each generation.

Then, simply call `scail.run` to run the ruleset.


![Belusov-Zhabotinsky gif](media/bz-gif.gif)

## Demos
See the following video for a demonstration on how to write code using this
library.

See the demos folder for a lot more (and more varied) examples on how to use the 
library. Written demo automata include:

- Conway's game of life
- The modified game of life with extinction
- Langton's ant 

![Langton gif](media/langton-gif.gif)
- Wireworld
- Rock-Paper-Scissors automata 
- Belusov-Zhabotinsky reaction (https://www.hermetic.ch/pca/bz.htm)
- the Mandelbrot and Julia sets
- A simulation of grain growth in metals (https://www.sciencedirect.com/science/article/pii/1359646296000553)
- And lastly, this demo of many of the above rulesets combined into one 
ruleset and run all together, then displayed as a weighted average

![everything gif](media/everything-gif.gif)

## Other

### Kernel Caching
Kernel caching is an option you can enable through `kernels.initialize_kernel_caching`
If this is set, then instead of being calculated every frame, the neighborhoods
of a given point will be calculated once then cached. This will probably
not cause any issues unless you change your neighborhood strategy mid-simulation.

Still, I didn't notice a significant speedup upon implementing caching, so for now
it is just an option that is turned off by default.
