Skip to content

Commit 3789cc7

Browse files
committed
Put Fire Simple models back to how they were until next edition of Textbook comes out (or until they are ready to put up errata)
1 parent eb56f4d commit 3789cc7

4 files changed

Lines changed: 27 additions & 38 deletions

File tree

IABM Textbook/chapter 3/Fire Extensions/Fire Simple Extension 1.nlogox

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -8,17 +8,14 @@ to setup
88
clear-all
99
;; make some green trees
1010
ask patches [
11-
if (random 100) < density [ set pcolor green ]
12-
]
13-
14-
;; Count initial trees before lighting trees on fire to get accurate calculation of percent burned
15-
set initial-trees count patches with [pcolor = green]
16-
17-
ask patches [
11+
if (random 100) < density
12+
[ set pcolor green ]
1813
;; make a column of burning trees at the left-edge
19-
if pxcor = min-pxcor [ set pcolor red ]
14+
if pxcor = min-pxcor
15+
[ set pcolor red ]
2016
]
21-
17+
;; keep track of how many trees there are
18+
set initial-trees count patches with [pcolor = green]
2219
reset-ticks
2320
end
2421

IABM Textbook/chapter 3/Fire Extensions/Fire Simple Extension 2.nlogox

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -8,17 +8,14 @@ to setup
88
clear-all
99
;; make some green trees
1010
ask patches [
11-
if (random 100) < density [ set pcolor green ]
12-
]
13-
14-
;; Count initial trees before lighting trees on fire to get accurate calculation of percent burned
15-
set initial-trees count patches with [pcolor = green]
16-
17-
ask patches [
11+
if (random 100) < density
12+
[ set pcolor green ]
1813
;; make a column of burning trees at the left-edge
19-
if pxcor = min-pxcor [ set pcolor red ]
14+
if pxcor = min-pxcor
15+
[ set pcolor red ]
2016
]
21-
17+
;; keep track of how many trees there are
18+
set initial-trees count patches with [pcolor = green]
2219
reset-ticks
2320
end
2421

IABM Textbook/chapter 3/Fire Extensions/Fire Simple Extension 3.nlogox

Lines changed: 6 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -8,21 +8,17 @@ to setup
88
clear-all
99
;; make some green trees
1010
ask patches [
11-
if (random 100) < density [ set pcolor green ]
12-
]
13-
14-
;; Count initial trees before lighting trees on fire to get accurate calculation of percent burned
15-
set initial-trees count patches with [pcolor = green]
16-
17-
ask patches [
11+
if (random 100) < density
12+
[ set pcolor green ]
1813
;; make a column of burning trees at the left-edge
19-
if pxcor = min-pxcor [ set pcolor red ]
14+
if pxcor = min-pxcor
15+
[ set pcolor red ]
2016
]
21-
17+
;; keep track of how many trees there are
18+
set initial-trees count patches with [pcolor = green]
2219
reset-ticks
2320
end
2421
25-
2622
to go
2723
;; stop the model when done
2824
if all? patches [pcolor != red]

IABM Textbook/chapter 3/Fire Extensions/Fire Simple.nlogox

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -8,17 +8,16 @@ to setup
88
clear-all
99
;; make some green trees
1010
ask patches [
11-
if (random 100) < density [ set pcolor green ]
12-
]
13-
14-
;; Count initial trees before lighting trees on fire to get accurate calculation of percent burned
15-
set initial-trees count patches with [pcolor = green]
16-
17-
ask patches [
11+
if (random 100) < density [
12+
set pcolor green
13+
]
1814
;; make a column of burning trees at the left-edge
19-
if pxcor = min-pxcor [ set pcolor red ]
15+
if pxcor = min-pxcor [
16+
set pcolor red
17+
]
2018
]
21-
19+
;; keep track of how many trees there are
20+
set initial-trees count patches with [pcolor = green]
2221
reset-ticks
2322
end
2423
@@ -43,7 +42,7 @@ end
4342
<widgets>
4443
<view x="200" wrappingAllowedX="false" y="10" frameRate="30.0" minPycor="-125" height="506" showTickCounter="true" patchSize="2.0" fontSize="10" wrappingAllowedY="false" width="506" tickCounterLabel="ticks" maxPycor="125" updateMode="1" maxPxcor="125" minPxcor="-125"></view>
4544
<monitor x="43" precision="1" y="152" height="60" fontSize="11" width="115" display="percent burned">(count patches with [shade-of? pcolor red]) / initial-trees * 100</monitor>
46-
<slider x="5" step="1.0" y="38" max="99.0" width="185" display="density" height="50" min="0.0" direction="Horizontal" default="99.0" variable="density" units="%"></slider>
45+
<slider x="5" step="1.0" y="38" max="99.0" width="185" display="density" height="50" min="0.0" direction="Horizontal" default="57.0" variable="density" units="%"></slider>
4746
<button x="106" y="96" height="40" disableUntilTicks="true" forever="true" kind="Observer" width="69" display="go">go</button>
4847
<button x="26" y="96" height="40" disableUntilTicks="false" forever="false" kind="Observer" width="70" display="setup">setup</button>
4948
</widgets>

0 commit comments

Comments
 (0)