Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.
Upcoming SlideShare
×

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

925 views

Published on

Published in: Education, Technology, Business
• Full Name
Comment goes here.

Are you sure you want to Yes No
Your message goes here
• Be the first to comment

• Be the first to like this

### 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