https://github.com/8nhuman8/nebular-automata
The program for visualizing a probabilistic cellular automata
https://github.com/8nhuman8/nebular-automata
cellular-automata probabilistic-models python stochastic-simulation visualization
Last synced: 5 months ago
JSON representation
The program for visualizing a probabilistic cellular automata
- Host: GitHub
- URL: https://github.com/8nhuman8/nebular-automata
- Owner: 8nhuman8
- License: mit
- Created: 2020-05-15T16:04:07.000Z (about 6 years ago)
- Default Branch: master
- Last Pushed: 2025-03-21T07:35:26.000Z (about 1 year ago)
- Last Synced: 2025-03-21T08:29:01.864Z (about 1 year ago)
- Topics: cellular-automata, probabilistic-models, python, stochastic-simulation, visualization
- Language: Python
- Homepage: https://t.me/nebular_automata
- Size: 53.9 MB
- Stars: 3
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Nebular Automata
The program for visualizing a probabilistic cellular automata

## Table of contents
- [Idea](#idea)
- [Installation](#installation)
- [Usage](#usage)
- [Command-line arguments description](#command-line-arguments-description)
- [Credits and references](#credits-and-references)
- [License](#license)
- [Gallery](#gallery)
## Idea
> The original idea was found [here](https://vk.com/math_dosug?w=wall-149993556_46382), and the author is this [person](https://vk.com/id504076319).
Let a square be surrounded on each side by a new square of the same size with a chance of **q**. Newly formed squares reproduce other squares and so on, to infinity.
We will limit the growth of the population by setting a certain maximum allowable number of squares, upon reaching which the program will be completed.
As you probably noticed when looking at the images [below](#gallery), the edges of the shapes have a different color, into which the initial color smoothly flows. This was done not only to illustrate the process of structure development, but also for greater saturation and prettiness of images.
## Installation
Install/upgrade required packages with `pip install -r requirements.txt --upgrade`.
## Usage
1. Check out all the command-line parameters [below](#command-line-arguments-description).
2. Then you can specify the colors and allowed reproduction directions in the [`config.json`](configs/config.json).
3. Run the `renderer.py` with `python src/renderer.py [parameters you need]`.
## Command-line arguments description
```console
usage: renderer.py [-h] [-sp Y X] [-p FLOAT] [-mc INT] [-minp FLOAT] [-maxp FLOAT] [-rc] [-rbg] [-cn INT] [-s INT] [-o] [-fi] [-t] [-si] [-pi PATH] [-dsi] [-sv]
[-pv PATH] [-vfps INT] [-vs INT] [-sg] [-pg PATH] [-gd INT]
width height
options:
-h, --help show this help message and exit
Required options:
width The width of the image.
height The height of the image.
Basic options:
-sp Y X, --start-point Y X
The coordinate of a starting point. Default value: middle of the image.
-p FLOAT, --probability FLOAT
The probability that a square will multiply in a one direction. Default value: 0.51
-mc INT, --max-count INT
The maximum number of squares in the image. Default value: (width * height) // 2.
-minp FLOAT, --min-percent FLOAT
The program will work until the nebula is filled with a chosen or greater percentage.
-maxp FLOAT, --max-percent FLOAT
The program will work until the nebula is filled with a chosen percentage.
Coloring options:
-rc, --random-colors All colors will be chosen randomly.
-rbg, --random-background
The background color will be chosen randomly.
-cn INT, --colors-number INT
The number of colors to use in the image. Default value: 3. Use with: -rc.
Additional options:
-s INT, --seed INT The program will generate the nebula based on the entered seed. In this case, the generation time is significantly increased.
-o, --opaque All colors will be opaque including background.
-fi, --fade-in Starting color is white. The color of each new generation will fade into the specified color. Use with: -rc -cn 1
-t, --torus The nebula will develop on a grid with toroidal topology.
Image options:
-si, --save-image The rendered image will be saved.
-pi PATH, --path-image PATH
The path where the image will be saved. Default path: output/
-dsi, --dont-show-image
Do not show image in the end.
Video options:
-sv, --save-video The rendered video will be saved.
-pv PATH, --path-video PATH
The path where the video will be saved. Default path: output/
-vfps INT, --video-fps INT
The frame rate of the video. Default value: 60.
-vs INT, --video-size INT
The size of the video in MB to which the size of the original video will be reduced using compression.
GIF options:
-sg, --save-gif The rendered GIF will be saved.
-pg PATH, --path-gif PATH
The path where the GIF will be saved. Default path: output/
-gd INT, --gif-duration INT
The display duration of each frame of the GIF in milliseconds. Default value: 30.
```
## Credits and references
The original idea was found [here](https://vk.com/math_dosug?w=wall-149993556_46382), and the author is this [person](https://vk.com/id504076319).
## License
[Nebular Automata](https://github.com/8nhuman8/nebular-automata) specific code is distributed under [MIT License](https://github.com/8nhuman8/nebular-automata/blob/master/LICENSE).
Copyright (c) 2022 Artyom Bezmenov
## Gallery



