In this repo you find a basic implementation of a random walk simulation in 2-dimensional space taken from this blogpost. Running the code yields an image which shows the path of the random walk.
The result will be directly shown to the user and additionally saved as png.
An example for the landscape raster walker
- clone repository
- setup a virtual environment
- activate the virtual environment
- install required libs and packages locally (see requirements.txt)
- activate the corresponding virtual environment
- run
conda install -c conda-forge click
- run
pip install --editable .
$ random_walker
Usage: random_walker [OPTIONS] COMMAND [ARGS]...
Options:
--verbose TEXT Will print verbose messages.
--help Show this message and exit.
Commands:
run execute command to generate random walkers
Usage: random_walker run [OPTIONS]
execute command to generate random walkers
Options:
-ts, --total_steps INTEGER Specify the number of total steps for each
random walker, Default is 10,000, Minimum 100
-tw, --total_walkers INTEGER Specify the number of total walkers, Default
is 1, Minimum is 1
-ss, --step_size INTEGER Specify the size of the steps taken, Default
is 1
-l, --landscape BOOLEAN Specify whether a grid landscape exists as
base layer or not, Default is False
-sp, --start_point BOOLEAN Specify whether the walkers shall start from
the same point or not, Default is False
-mp, --mov_pattern BOOLEAN Specify the neighborhood movement pattern,
False is Neumann, True is Moor
--help Show this message and exit.
random_walker run --total_steps 10000 --step_size 2 -l False