Lattice gas automata implemented in Python.
Project description
Lattice Gas Cellular Automata
This project contains Python implementation of the popular Lattice Gas Cellular Automata, listed below.
- HPP
- FHP I
- FHP II
- FHP III
[!WARNING] Work in progress...
Installation
Clone or download current project
git clone https://github.com/siciarek/lgca.git
go to the main project directory
cd lgca
and install it locally (using a Python virtual environment is strongly recommended).
python -m venv .venv
. .venv/bin/activate
pip install '.[dev]'
[!NOTE] The project will be available via
PyPIafter full implementation ofFHP III, at the moment is available only as described above.
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.1-py3-none-any.whl.
File metadata
- Download URL: lgca-0.1.1-py3-none-any.whl
- Upload date:
- Size: 44.7 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 |
913f0c61ec00092002ec5251e1d59a3f16c978a16c2c0e1fe25cac3daedebbc9
|
|
| MD5 |
9658fdb88974743ecd19e7907bd86280
|
|
| BLAKE2b-256 |
bd16c36a6dbe4e5879c93febda25a11b2a8712a496808a87e51ffb3d8ebcb952
|