Skip to content

pmandera/sandpile-model

master
Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
Code

Latest commit

 

Git stats

Files

Permalink
Failed to load latest commit information.
Type
Name
Latest commit message
Commit time
 
 
 
 
 
 
 
 
 
 

Abelian sandpile

This code allows to create, grow and visualize Abelian sandpiles.

Example sandplie

For the description of the model see wiki or p. 52-53 in Bak (1996).

Setup

Install requirenemtns and build Cython code to make it run signingicantly faster.

pip install -r requirements.txt
python setup.py build_ext --inplace

Usage

Pour sand on the sandpile and save the sandpile after each 1000 grains.

./sandpile_main.py pour --verbose \
  --grid_size 200 --n_steps 1e5 --checkpoint_every 1e3 \
  --checkpoint_dir ./checkpoints  --store_avalanche_sizes

Plot the sandpile grid.

./sandpile_main.py plot \
  ./checkpoints/sandpile-000007470000.pckl.gz ./data/plots/ 

License

This code was written by Paweł Mandera and is licensed under the Apache License 2.0.

References

Bak, P. (1996). How Nature Works: The Science of Self-Organized Criticality. New York: Copernicus.

About

Abelian sandpile model

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages