Skip to content

Commit 5f1b9c6

Browse files
committed
deploy: f41a3a7
0 parents  commit 5f1b9c6

File tree

690 files changed

+49419
-0
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

690 files changed

+49419
-0
lines changed

.nojekyll

Whitespace-only changes.

assignments/PoPS_calibration.html

Lines changed: 150 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,150 @@
1+
<!DOCTYPE html>
2+
<html lang="en">
3+
<head>
4+
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
5+
<title>NCSU GIS 714: Geospatial Computation and Simulations</title>
6+
7+
<link rel="shortcut icon" href=".././img/favicon.ico" />
8+
9+
<link href="../layout.css" rel="stylesheet" type="text/css" media="screen">
10+
<link href="../style.css" rel="stylesheet" type="text/css" media="screen">
11+
12+
</head>
13+
14+
<body>
15+
16+
<div id="outercontainer">
17+
<div id="container">
18+
19+
<header>
20+
<div id="header-image">
21+
<h1>NCSU GIS 714:<br>Geospatial Computing and Simulations</h1>
22+
</div>
23+
24+
<nav>
25+
<ul class="nav">
26+
<li><a href="../index.html">Syllabus</a></li>
27+
<li><a href="../schedule.html">Schedule</a></li>
28+
<li><a href="../logistics.html">Course logistics</a></li>
29+
<li><a href="../topics/index.html">Topics</a></li>
30+
<li><a href="../projects.html">Projects</a></li>
31+
</ul>
32+
</nav>
33+
34+
</header>
35+
36+
<main>
37+
<!-- This is a generated file. Do not edit. -->
38+
<h2>PoPS calibration</h2>
39+
40+
Resources to download:
41+
<ul>
42+
<li><a href="http://fatra.cnr.ncsu.edu/pops/data/SOD_ABC_calibration.zip">test data</a></li>
43+
<li><a href="../resources/SOD_ABC_calibration.R">PoPS calibration R script</a></li>
44+
</ul>
45+
46+
R software:
47+
<ul>
48+
<li>install rpops, follow <a href="https://github.com/ncsu-landscape-dynamics/rpops#how-to-install"> installation instructions</a></li>
49+
<li>install <a href="https://cran.r-project.org/web/packages/folderfun/index.html">folderfun</a> package
50+
</ul>
51+
52+
53+
54+
<h3>Tasks</h3>
55+
Run the calibration code to derive parameters for spore rate, distance and direction strength for SOD based on 2018.
56+
Unzip the dataset to a folder and change the path to that folder in the R script.
57+
The script will output information about the progress of calibration.
58+
<ul>
59+
<li>What role does generation size and number of generations play in the calibration process?
60+
Change them and observe the impacts.</li>
61+
<li>Change the thresholds of accepting a parameter set (checks variable).
62+
Observe the impacts.</li>
63+
<li>Inspect the results of the calibration.</li>
64+
</ul>
65+
<!--
66+
<p>Outline:
67+
<ul>
68+
<li>Use provided test data to calibrate PoPS model</li>
69+
<li>Use parameters derived from calibration to validate PoPS outputs</li>
70+
<li>Try to answer questions below</li>
71+
</ul>
72+
73+
<p>
74+
Resources to download:
75+
<ul>
76+
<li><a href="http://fatra.cnr.ncsu.edu/pops/data/calibration_validation_sample_data.zip">test data</a></li>
77+
<li><a href="../resources/PoPS_calibration.R">PoPS calibration R script</a></li>
78+
<li><a href="../resources/PoPS_validation.R">PoPS validation R script</a></li>
79+
</ul>
80+
81+
Run each block in the provided R scripts step by step and see the associated instructions as comments in the code.
82+
83+
<h3>Calibration</h3>
84+
Run the calibration code to derive parameters for spore rate and distance for the PoPs model.
85+
<ul>
86+
<li>What are the parameters?</li>
87+
<li>How many times were the spore rate and distance parameters used out of the total number of calibration iterations?</li>
88+
<li>What does the distribution of the two parameters look like?</li>
89+
</ul>
90+
91+
Optional:
92+
<ul>
93+
<li>Try different numbers of iterations. Are derived parameters different?</li>
94+
<li>Try turning management on (line 22). Are derived parameters different?</li>
95+
</ul>
96+
97+
98+
<h3>Validation</h3>
99+
Use the parameters derived from the calibration code to run the PoPS model and
100+
validate the outputs using the validation code.
101+
<ul>
102+
<li>What was the average disagreement and landscape similarity?</li>
103+
</ul>
104+
105+
Optional:
106+
<ul>
107+
<li>Try with management on (line 24). How are the total disagreement and landscape similarity affected?</li>
108+
<li>Try with different spore rate and distance parameters. How are total disagreement and landscape similarity affected?</li>
109+
<li>Try with different conditions. How are total disagreement and landscape similarity affected?
110+
<ul>
111+
<li>With mortality on - Set mortality to "TRUE" and you can change the
112+
conditions for time lag and mortality rate (lines 28-30)</li>
113+
<li>With wind direction on - Can set wind to "N", "S", "W", "E".
114+
Higher kappa values make the wind direction stronger (lines 33-34).</li>
115+
</ul>
116+
</li>
117+
</ul>
118+
-->
119+
120+
</main>
121+
122+
<footer>
123+
124+
<nav>
125+
<ul>
126+
<li><a class="term-changes" href="https://moodle-courses2527.wolfware.ncsu.edu/course/view.php?id=5978">Moodle site</a></li>
127+
<li><a href="https://help.ncsu.edu/">Computing Help</a></li>
128+
<li><a href="https://geospatial.ncsu.edu/">GIST Home</a></li>
129+
<li><a href="https://www.ncsu.edu/policies/prr-disclaimer.php">Disclaimer</a></li>
130+
<li><a href="https://oit.ncsu.edu/itaccess">Accessibility</a></li>
131+
<li>
132+
<a href="https://github.com/ncsu-geoforall-lab/geospatial-simulations-course" title="Source code for web pages on GitHub">
133+
<img src="../img/github_logo.png" alt="GitHub Octocat logo">
134+
</a>
135+
</li>
136+
<li title="Copyright and license (not applicable to linked materials)">
137+
&copy; 2023
138+
<a href="https://creativecommons.org/licenses/by-sa/4.0/">CC BY-SA</a>
139+
<a href="https://geospatial.ncsu.edu/geoforall/">NCSU GeoForAll Lab</a>
140+
</li>
141+
</ul>
142+
</nav>
143+
144+
</footer>
145+
146+
</div>
147+
</div>
148+
149+
</body>
150+
</html>

assignments/abm.html

Lines changed: 151 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,151 @@
1+
<!DOCTYPE html>
2+
<html lang="en">
3+
<head>
4+
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
5+
<title>NCSU GIS 714: Geospatial Computation and Simulations</title>
6+
7+
<link rel="shortcut icon" href=".././img/favicon.ico" />
8+
9+
<link href="../layout.css" rel="stylesheet" type="text/css" media="screen">
10+
<link href="../style.css" rel="stylesheet" type="text/css" media="screen">
11+
12+
</head>
13+
14+
<body>
15+
16+
<div id="outercontainer">
17+
<div id="container">
18+
19+
<header>
20+
<div id="header-image">
21+
<h1>NCSU GIS 714:<br>Geospatial Computing and Simulations</h1>
22+
</div>
23+
24+
<nav>
25+
<ul class="nav">
26+
<li><a href="../index.html">Syllabus</a></li>
27+
<li><a href="../schedule.html">Schedule</a></li>
28+
<li><a href="../logistics.html">Course logistics</a></li>
29+
<li><a href="../topics/index.html">Topics</a></li>
30+
<li><a href="../projects.html">Projects</a></li>
31+
</ul>
32+
</nav>
33+
34+
</header>
35+
36+
<main>
37+
<!-- This is a generated file. Do not edit. -->
38+
<h2>Agent Based Modeling</h2>
39+
40+
<p>
41+
Resources:
42+
<ul>
43+
<li><a href="http://grass.osgeo.org/grass-stable/manuals/">
44+
GRASS GIS overview and manual</a>
45+
<li><a href="http://www.grassbook.org/">GRASS book</a>
46+
<li><a href="https://grass.osgeo.org/grass-stable/manuals/addons/r.landscape.evol.html">r.landscape.evol</a>
47+
<li><a href="https://github.com/projectmesa/mesa/">MESA: agent based modeling in Python</a>
48+
</ul>
49+
50+
<h3>Agent Based Modeling in Python using Mesa</h3>
51+
We will install ABM framework <a href="https://mesa.readthedocs.io/en/master/">MESA</a>,
52+
run some example models, and then modify and expand the fire model to reuse it as a tree disease spread model.
53+
54+
<h4>Installation</h4>
55+
Use pip to install Mesa, note that Mesa requires Python 3:
56+
57+
<pre><code>pip install mesa
58+
</code></pre>
59+
60+
Test if successfull:
61+
<pre><code>mesa --help
62+
# alternatively ~/.local/bin/mesa --help
63+
</code></pre>
64+
65+
Download <a href="https://github.com/projectmesa/mesa/archive/v0.8.5.zip">Mesa v0.8.5</a>, unzip and in command line go to examples folder,
66+
pick an example folder (for example <code>Schelling</code>) and install dependencies:
67+
<pre><code>pip install -r requirements.txt
68+
</code></pre>
69+
70+
<pre><code>mesa runserver
71+
</code></pre>
72+
Inspect the code in <code>model.py</code> defining the agent rules.
73+
74+
<h4>From fire to disease spread ABM</h4>
75+
Copy folder <code>forest_fire</code> and rename it to <code>disease_spread</code>.
76+
Now run the model in the same way and observe the behavior.
77+
Inspect the code in <code>model.py</code>, <code>agent.py</code> and <code>server.py</code>.
78+
<p>
79+
Now the task is to change and expand the forest fire model to represent a tree disease spread simulation.
80+
Start by renaming the categories: "On Fire" to "Infected", "Burned Out" to "Dead".
81+
82+
Then independently work on these possible tasks, or come up with your own rules and behaviors:
83+
<ul>
84+
<li>Change mortality to have trees die after a specified number of steps </li>
85+
<li>Add stochastic behavior, for example, infect neighbor only with certain probability</li>
86+
<li>Increase distance how far the disease can spread
87+
(use <a href="https://mesa.readthedocs.io/en/master/apis/space.html#space.Grid.iter_neighbors"><code>model.grid.iter_neighbors</code></a>)</li>
88+
<li>Implement prevailing spread direction, can be stochastic</li>
89+
<li>Add another agent (use <a href="https://mesa.readthedocs.io/en/master/apis/space.html#space.MultiGrid"><code>MultiGrid</code></a>)
90+
who is doing random walk and spreading disease</li>
91+
<li>Add slider/dropdown box to the web interface to interactively explore the effects</li>
92+
</ul>
93+
94+
Solution can be found <a href="https://github.com/ncsu-geoforall-lab/mesa-teaching-example">here</a>.
95+
96+
97+
98+
<h3>Modeling coupled human and natural systems using MedlanD </h3>
99+
Things to download:
100+
<ul>
101+
<li><a href="../resources/r.landscape.evol2.py">r.landscape.evol2</a></li>
102+
<li><a href="../resources/r.agropast.adaptive2.py">r.agropast.adaptive2</a></li>
103+
<li><a href="https://drive.google.com/a/ncsu.edu/file/d/1aHTMkhhe52oXhEp1_qdunGwFSQBjZ7m_/view?usp=sharing">GRASS Location</a></li>
104+
<li><a href="https://drive.google.com/a/ncsu.edu/file/d/1dv7A7n6NC4_rHKnqRaSffJBEE6D6yyi9/view?usp=sharing">GRASS reclassification rules</a></li>
105+
</ul>
106+
Start GRASS in the provided Location and create new mapset.
107+
108+
Unzip the reclassification rules to a directory and place there the scripts r.agropast.adaptive2.py and r.landscape.evol2.py.
109+
Change to the directory where the rule files and the scripts are and run the simulation for 3 iterations:
110+
111+
<pre><code>python3 r.agropast.adaptive2.py -1 numpeople=30 years=3 prefx=sim costsurf=farm_catch_10yr_30ppl_cost_surface agcatch=farm_catch_10yr_30ppl grazecatch=graze_catch fodder_rules=fodder_rules.txt inlcov=init_veg infert=init_fert lc_rules=luse_reclass_rules.txt cfact_rules=cfactor_recode_rules.txt elev=DEM initbdrk=init_bdrk
112+
</code></pre>
113+
114+
115+
<!-- If you want to set up your own geographic locale for this, you'll also need r.catchment -->
116+
<!-- "https://github.com/comses/medland/blob/master/Scripts/r.catchment.py" -->
117+
118+
<!-- there is also a spreadsheet with default values for agropastoral economy - get the numbers into the assignment webpage -->
119+
120+
121+
</main>
122+
123+
<footer>
124+
125+
<nav>
126+
<ul>
127+
<li><a class="term-changes" href="https://moodle-courses2527.wolfware.ncsu.edu/course/view.php?id=5978">Moodle site</a></li>
128+
<li><a href="https://help.ncsu.edu/">Computing Help</a></li>
129+
<li><a href="https://geospatial.ncsu.edu/">GIST Home</a></li>
130+
<li><a href="https://www.ncsu.edu/policies/prr-disclaimer.php">Disclaimer</a></li>
131+
<li><a href="https://oit.ncsu.edu/itaccess">Accessibility</a></li>
132+
<li>
133+
<a href="https://github.com/ncsu-geoforall-lab/geospatial-simulations-course" title="Source code for web pages on GitHub">
134+
<img src="../img/github_logo.png" alt="GitHub Octocat logo">
135+
</a>
136+
</li>
137+
<li title="Copyright and license (not applicable to linked materials)">
138+
&copy; 2023
139+
<a href="https://creativecommons.org/licenses/by-sa/4.0/">CC BY-SA</a>
140+
<a href="https://geospatial.ncsu.edu/geoforall/">NCSU GeoForAll Lab</a>
141+
</li>
142+
</ul>
143+
</nav>
144+
145+
</footer>
146+
147+
</div>
148+
</div>
149+
150+
</body>
151+
</html>

0 commit comments

Comments
 (0)