GPCA (General-Purpose Cellular Automata)
General-Purpose Cellular Automata (GPCA) is a Rust implementation of the computational model known as Async Hyper-Graph Cellular Automata. This library provides a framework for simulating and experimenting with complex systems through autómata cellular dynamics, utilizing parallel computing and GPU acceleration for enhanced performance.
Features
- Async Hyper-Graph Cellular Automata: Advanced cellular automata model that operates on hypergraphs asynchronously.
- Cyclic Cellular Automata: Simulation of cellular automata with cyclic states and customizable thresholds.
- Life-like Cellular Automata: Variants of Conway's Game of Life, with fully customizable birth and survival rules.
- Elementary Cellular Automata: Implementation of elementary 1D cellular automata with binary rules.
- GPU Acceleration: Utilizes
wgpufor GPU-accelerated computations and simulations. - Parallel Processing: Leveraging
rayonfor parallel computation, ensuring efficient performance on multi-core systems. - Visualization: Easily create images of simulation states, with customizable color gradients and mapping.
- 2D and 3D support (upcoming): Current support for 2D automata with a planned extension to 3D models.
Installation
To use GPCA in your Rust project, add the following dependency to your Cargo.toml:
[]
= { = "0.1.0"}
Example
Below is an example that demonstrates how to simulate a 2D cyclic cellular automaton with 8 states:
use ;
use tqdm;
async
Project Structure
- dynamics/: Contains the implementations of various cellular automata models.
- cyclic.rs: Cyclic automaton implementation.
- life.rs: Life-like automaton implementation.
- eca.rs: Elementary cellular automata.
- spaces/: Defines the hypergraph space and the lattice structure for automata to operate in.
- system/: The dynamical system that governs the updates and evolution of the automata.
- third/: Contains GPU-related functionality, including shaders for computation.
Future Plans
- 3D Cellular Automata: Extend support for 3D hyper-graph cellular automata.
- Advanced Visualization: Introduce real-time interactive visualizations for cellular automata using WebGPU.
- Rule-based Cellular Automata: Support for custom rule definitions via user input.
Contributions
Contributions are welcome! Feel free to open an issue or submit a pull request with new features, bug fixes, or improvements.
License
This project is licensed under the MIT License.