Lattice gas automata implemented in Python.
Project description
Lattice Gas Cellular Automata
[!WARNING] Work in progress...
This project contains Python implementation of the popular Lattice Gas Cellular Automata, listed below.
Models with checked names are implemented and ready to use.
- HPP
- FHP I
- FHP II
- FHP III
Installation
Install using pip (creating a Python virtual environment first is strongly recommended).
pip install lgca
Usage
To get some information about the application just run:
lgca --help
and You should see something like below.
pygame 2.5.2 (SDL 2.28.3, Python 3.12.7)
Hello from the pygame community. https://www.pygame.org/contribute.html
Usage: lgca [OPTIONS]
Lattice Gas Cellular Automata [X] HPP [X] FHP I [X] FHP II [ ] FHP III
Options:
-v, --value INTEGER RANGE Content value. [default: 0; 0<=x<=255]
-n, --model-name [HPP|FHPI|FHPII|FHPIII|hpp|fhpi|fhpii|fhpiii]
Model name. [default: HPP]
-w, --width INTEGER Lattice window width. [default: 300]
-h, --height INTEGER Lattice window height. [default: 200]
-s, --steps INTEGER Number of steps. [default: -1]
-r, --run Run immediately.
-d, --deterministic Generate the same randomized result for the
same params. [default: True]
-p, --pattern [wiki|random|alt|single|obstacle|test]
Select initial state pattern. [default:
wiki]
--help Show this message and exit.
So the sample usage can look like this
lgca --run
The above command should display the HPP model visualization, identical to the one on Wikipedia.
https://en.wikipedia.org/wiki/HPP_model
- To start/stop the application just press the space button.
- To reset app to the initial state press the S button.
- To quit the app pres ESC button or quit the window.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distributions
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file lgca-0.1.2-py3-none-any.whl.
File metadata
- Download URL: lgca-0.1.2-py3-none-any.whl
- Upload date:
- Size: 44.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.0.1 CPython/3.12.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
c2db345cb58fa17fd871f633f7d41438e0a49598fe319ae63fcd3dd161a35930
|
|
| MD5 |
faf4928244765efca34c729ab36462a6
|
|
| BLAKE2b-256 |
8b10b96d43e26ac47fde4b73ab9d195d5104b0450fc152986649f742f1b10253
|