Introduction to Computing
for Complex Systems
(Lab Session 2)
daniel martin katz
illinois institute of technology
chicago ...
The Complete Code
for the
Forest Fire model
The Forest
Fire Model
the setup
procedure
1st Operation is to Clear Everything
(a) The World Consists of
Turtles and Patches
(c) Default is Now “square”
(b) Turtle Can Assume
lots of Shapes
(d) What is...
(a) Call on Our Patches
Using “Ask Patches”
(b) But Only A Certain
Random Set of Patches
look at the brackets,
what do these brackets do?
we need to learn these primitives:
ask patches
random-float
The Ask Primitive
Random-Float
(a) Call on Our Patches
Using “Ask Patches”
(b) But Only A Certain
Random Set of Patches
(c) Patches With < “Density”
(d) ...
With What Criteria?
pxcor = min-pxcor
[Notice The Brackets]
Again it is the
“ask” “patches with”
(a) Again it is the “Ask”
“Patches With”
(b) pxcor = min-pxcor
(c) To Ingnite
Here is where pxcor = min-pxcor
(i.e. Where ...
How Does It Know What
“Ignite” Means?
With What Criteria?
pxcor = min-pxcor
[Notice The Brackets]
To Do What?
Ignite
Consu...
Here is How
(We Will Return
to This in a Few)
Lets Look at the Set Command
variable= initial-trees
value= count patches with
[patchcolor =green]
set variable value
variable= burned-trees
set variable value
value= numeric value of 0
notice how
within ‘setup’
these globals
are ultimately
assigned a
value
Modular Code:
notice how the 

[ ignite ]
procedures are
defined below
“sprout-fires 1” ?
[ set color red]
note: color versus pcolor
this implies turtle not patch
(see dictionary for distinction)
fire turtle is s...
Modular Code:
now notice how
[fade-embers]
procedures are
defined below
[ set color color - 0.3]
makes the red darker
“ask embers”
embers are a breed
if color < red - 3.5
‘If’ is a conditional
(...
[ set color color - 0.3]
makes the red darker
“ask embers”
embers are a breed
[set pcolor color die]
if color < red - 3.5
...
We will focus
upon the ‘to go’
procedure in
the next class
3-D perspective on the model
as it runs
notice how these turtles on the terrain
Exploration of the
Forest Fire Model
(1) Modify the Color of the
Forest to Blue
(2) Make the Fire Move North to
South Inst...
Modify the Color of the
Forest to Blue
What Elements of the Code
Do We Modify?
The Forest Fire
Model
Procedures
The Forest Fire
Model
Procedures
Make the Fire Move North to
South Instead of West to East
Make the Fire Move North to
South Instead of West to East
What Elements of the Code
Do We Modify?
The Forest Fire
Model
Procedures
The Forest Fire
Model
Procedures
Try this
Instead:
What is a Dependancy?
In Class Exercise:
Identify Dependancies
in Fire Model
Why Does It Matter?
How Can We Represent Thos...
Lets Discuss
the Results
Mapping
of the
Code
In what sense is this model random?
In what sense is this model deterministic?
Thinking conceptually
about the model proce...
In what sense is this model random?
Thinking conceptually
about the model procedures
Placement of the patches
subject to t...
Watch the Model in 3D
Watch the Model in 3D
Watch the Model in 3D
Watch the Model in 3D
Watch the Model in 3D
In what sense is this model deterministic?
Thinking conceptually
about the model procedures
The fire is really for G.U.I. ...
ICPSR - Complex Systems Models in the Social Sciences - Lab Session 2 - Professor Daniel Martin Katz
ICPSR - Complex Systems Models in the Social Sciences - Lab Session 2 - Professor Daniel Martin Katz
ICPSR - Complex Systems Models in the Social Sciences - Lab Session 2 - Professor Daniel Martin Katz
ICPSR - Complex Systems Models in the Social Sciences - Lab Session 2 - Professor Daniel Martin Katz
ICPSR - Complex Systems Models in the Social Sciences - Lab Session 2 - Professor Daniel Martin Katz
Upcoming SlideShare
Loading in …5
×

ICPSR - Complex Systems Models in the Social Sciences - Lab Session 2 - Professor Daniel Martin Katz

794 views

Published on

Published in: Education, Technology, Business
0 Comments
0 Likes
Statistics
Notes
  • Be the first to comment

  • Be the first to like this

No Downloads
Views
Total views
794
On SlideShare
0
From Embeds
0
Number of Embeds
2
Actions
Shares
0
Downloads
64
Comments
0
Likes
0
Embeds 0
No embeds

No notes for slide

ICPSR - Complex Systems Models in the Social Sciences - Lab Session 2 - Professor Daniel Martin Katz

  1. 1. Introduction to Computing for Complex Systems (Lab Session 2) daniel martin katz illinois institute of technology chicago kent college of law @computationaldanielmartinkatz.com computationallegalstudies.com
  2. 2. The Complete Code for the Forest Fire model
  3. 3. The Forest Fire Model
  4. 4. the setup procedure
  5. 5. 1st Operation is to Clear Everything
  6. 6. (a) The World Consists of Turtles and Patches (c) Default is Now “square” (b) Turtle Can Assume lots of Shapes (d) What is the plain english version of this line of code? (e) set-default-shape for turtles to “square”
  7. 7. (a) Call on Our Patches Using “Ask Patches” (b) But Only A Certain Random Set of Patches
  8. 8. look at the brackets, what do these brackets do? we need to learn these primitives: ask patches random-float
  9. 9. The Ask Primitive
  10. 10. Random-Float
  11. 11. (a) Call on Our Patches Using “Ask Patches” (b) But Only A Certain Random Set of Patches (c) Patches With < “Density” (d) Set Patch Color Green
  12. 12. With What Criteria? pxcor = min-pxcor [Notice The Brackets] Again it is the “ask” “patches with”
  13. 13. (a) Again it is the “Ask” “Patches With” (b) pxcor = min-pxcor (c) To Ingnite Here is where pxcor = min-pxcor (i.e. Where Pxcor =0)
  14. 14. How Does It Know What “Ignite” Means? With What Criteria? pxcor = min-pxcor [Notice The Brackets] To Do What? Ignite Consult Netlogo Dictionary? Is it there?
  15. 15. Here is How (We Will Return to This in a Few)
  16. 16. Lets Look at the Set Command
  17. 17. variable= initial-trees value= count patches with [patchcolor =green] set variable value
  18. 18. variable= burned-trees set variable value value= numeric value of 0
  19. 19. notice how within ‘setup’ these globals are ultimately assigned a value
  20. 20. Modular Code: notice how the 
 [ ignite ] procedures are defined below
  21. 21. “sprout-fires 1” ?
  22. 22. [ set color red] note: color versus pcolor this implies turtle not patch (see dictionary for distinction) fire turtle is set to red “sprout-fires 1” sprouting of a turtle from breed = fires and a 1 per patch set pcolor black setting patch color to black set burned-trees to burned-trees +1
  23. 23. Modular Code: now notice how [fade-embers] procedures are defined below
  24. 24. [ set color color - 0.3] makes the red darker “ask embers” embers are a breed if color < red - 3.5 ‘If’ is a conditional (balance of the command is triggered if condition is met) Allows a slow fading of embers What does color < red - 3.5 imply?
  25. 25. [ set color color - 0.3] makes the red darker “ask embers” embers are a breed [set pcolor color die] if color < red - 3.5 ‘If’ is a conditional (balance of the command is triggered if condition is met) Allows a slow fading of embers What does color < red - 3.5 imply?
  26. 26. We will focus upon the ‘to go’ procedure in the next class
  27. 27. 3-D perspective on the model as it runs
  28. 28. notice how these turtles on the terrain
  29. 29. Exploration of the Forest Fire Model (1) Modify the Color of the Forest to Blue (2) Make the Fire Move North to South Instead of West to East
  30. 30. Modify the Color of the Forest to Blue
  31. 31. What Elements of the Code Do We Modify?
  32. 32. The Forest Fire Model Procedures
  33. 33. The Forest Fire Model Procedures
  34. 34. Make the Fire Move North to South Instead of West to East
  35. 35. Make the Fire Move North to South Instead of West to East
  36. 36. What Elements of the Code Do We Modify?
  37. 37. The Forest Fire Model Procedures
  38. 38. The Forest Fire Model Procedures Try this Instead:
  39. 39. What is a Dependancy? In Class Exercise: Identify Dependancies in Fire Model Why Does It Matter? How Can We Represent Those Dependancies in Our Code?
  40. 40. Lets Discuss the Results
  41. 41. Mapping of the Code
  42. 42. In what sense is this model random? In what sense is this model deterministic? Thinking conceptually about the model procedures all of these models involve a mixture of determinism and randomness
  43. 43. In what sense is this model random? Thinking conceptually about the model procedures Placement of the patches subject to the selected density level
  44. 44. Watch the Model in 3D
  45. 45. Watch the Model in 3D
  46. 46. Watch the Model in 3D
  47. 47. Watch the Model in 3D
  48. 48. Watch the Model in 3D
  49. 49. In what sense is this model deterministic? Thinking conceptually about the model procedures The fire is really for G.U.I. purposes result is basically already determined before the fire spreads

×