A compilation of my efforts and immense curiosities of what is this thing called computation?
Contributions and feedbacks (from anybody) are welcome.
I need to add visuals! Open the cellular-automata folder..
This is a simple implementation of a cellular automata in Python using Pygame. The current implementation is a one-dimensional automata which uses a pre-defined rule to determine the state of each cell at each iteration.
- Python 3.x
- Pygame library
To use this implementation, clone this repository and run the following command in the project directory:
python3 main.py
The automata will start running, and a Pygame window will open displaying the evolving states of the automata.
The automata can be configured by changing the parameters in the src/constants.py
file. The following parameters can be configured:
num_iter
: The number of iterations to run the automata formov_iter
: The number of iterations to show in the Pygame window at any given timerule
: The rule for the automata, in the form of a list of tuples. Each tuple should contain two elements: a tuple representing the frame to match, and an integer representing the state to set for the cell in the center of the frame. For example, the following is a rule that sets the center cell to 1 if the left and right cells are both 1, and 0 otherwise:
"rule": [
[
[(1, 1, 0), 1],
[(1, 0, 1), 1],
[(1, 0, 0), 0],
[(0, 1, 1), 1],
[(0, 1, 0), 0],
[(0, 0, 1), 0],
[(0, 0, 0), 0]
]
]
init_state
: The initial state of the automata, in the form of a list of 0s and 1s.
The purpose of this project is to provide a comprehensive tool to experiment with cellular and mobile automata.
main-1-rule-90-slow.mov
main-2-rule-90.mov
main-3-totalistic-cellular-automaton.mov
main-4-rule-2409.mov
One-dimensional cellular automata are a class of mathematical models that simulate the behavior of a line of cells, where each cell can have one of a finite number of states. At each time step, the state of each cell is updated based on the state of its neighbors according to a set of rules. These rules are often specified using a lookup table, which maps the current state of a cell and its neighbors to a new state. One-dimensional cellular automata have applications in a variety of fields, including physics, computer science, and biology. The goal of this project is to provide an implementation of a one-dimensional cellular automaton in Python that allows users to explore different rules and initial conditions, and to visualize the evolution of the system over time.
The project includes several features that are designed to enhance its usability and functionality. These features include:
-
User-friendly interface: The project includes a user-friendly interface that is easy to navigate and understand.
-
Customizable settings: The project includes customizable settings that allow users to tailor the tool to their specific needs.
To contribute to the project, users should follow these guidelines:
- Fork the project repository.
- Make the desired changes.
- Submit a pull request.
- Wait for feedback and approval from the project maintainers.
In conclusion, this project was inspired by the groundbreaking work of Stephen Wolfram in "A New Kind of Science". It aimed to explore the fundamental principles of cellular automata and its potential applications in various fields, including computer science, physics, biology, and social sciences. Through the implementation of various algorithms and simulations, this project provided valuable insights into the behavior of cellular automata and their potential implications for real-world phenomena. While there is still much to be explored in this field, the findings of this project serve as a strong foundation for future research and experimentation. Overall, this project represents a significant step forward in our understanding of cellular automata and their potential applications in a wide range of fields.
This project is licensed under the terms of the MIT license.
@vishalpaudel