-
Notifications
You must be signed in to change notification settings - Fork 147
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
r.random.walk: Add module to create random walks (#606)
The module implements a simple 2D random walk. The module currently allows for 4 and 8 directional walks for n number of steps over a given computational region. The module runs in parallel when computing an average walk from a single starting location or an average walk from multiple starting locations.
- Loading branch information
Showing
7 changed files
with
697 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
MODULE_TOPDIR = ../.. | ||
|
||
PGM = r.random.walk | ||
|
||
include $(MODULE_TOPDIR)/include/Make/Script.make | ||
|
||
default: script |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
<h2>DESCRIPTION</h2> | ||
The <em>r.random.walk</em> module generates a 2D random walk across the current computational region. | ||
The module provides control of the number of steps and directions (4 or 8) a walker can take and allows | ||
the walker's behavior to be set to be self-avoiding (Madras et al., 1996) or allow revisits. The output displays | ||
the frequency the walker visited each cell or the average frequency. The module can run multiple walks in | ||
parallel. It either samples the same starting location for each walk or generates a unique starting position | ||
for each walker. | ||
|
||
<h2>EXAMPLE</h2> | ||
Using the North Carolina full sample dataset: | ||
|
||
|
||
<div class="code"><pre> | ||
# set computational region | ||
g.region raster=elevation -p | ||
|
||
# calculate smoothed random walk from a single starting locations. | ||
r.random.walk -at output=random_walk_smooth_paths directions=8 steps=100000 memory=1800 seed=1 nprocs=6 nwalkers=100 | ||
</pre></div> | ||
<center> | ||
<img src="r_random_walk_example.png" width=600 border=0><br> | ||
Smoothed random walk (Single Starting Location) | ||
</center> | ||
|
||
<div class="code"><pre> | ||
# calculate smoothed random walk from a multiple starting locations. | ||
r.random.walk -as output=random_walk_smooth directions=8 steps=100000 memory=1800 nprocs=6 nwalkers=100 | ||
</pre></div> | ||
|
||
<center> | ||
<img src="r_random_walk_example_2.png" width=600 border=0><br> | ||
Smoothed random walk (Multiple Starting Locations) | ||
</center> | ||
|
||
<h2>SEE ALSO</h2> | ||
<a href="https://grass.osgeo.org/grass-stable/manuals/r.surf.fractal.html">r.surf.fractal</a>, | ||
<a href="https://grass.osgeo.org/grass-stable/manuals/r.surf.random.html">r.surf.random</a> | ||
|
||
<h2>AUTHOR</h2> | ||
Corey T. White, <a href="https://geospatial.ncsu.edu/geoforall/">NCSU GeoForAll Lab</a> |
Oops, something went wrong.