A live, configurable, simulator of Diffusion Limited Aggregation (DLA). DLA is the clustering of particles undergoing a random walk due to Brownian motion.
The core algorithm is simple:
- Initialize a 2d/3d space with at least 1 position marked as "filled" (occupied by a particle).
- Spawn a particle at an "unfilled" position.
- Simulate a random walk for said particle until it's directly adjacent (touching) an existing particle, at which point it will "stick" and "fill" its current position in the space.
- Repeat steps 2 and 3 until you've reached a desired number of particles, or the grid is full (and executing step 2 is no longer possible).
In this simulator, DLA is modeled on a 2d space in Rust using a Pixels frame buffer and egui GUI.
Visit benliepert.github.io/RDLA for a version (generated with trunk) that runs in your browser.
Or you can build and run the standalone app by using cargo run --release
at the root of this repo.
Thanks @parasyte for your Conway's Game of Life, Minimal Egui, and Minimal Web examples!