Salient Features of India constitution especially power and functions
ICPSR - Complex Systems Models in the Social Sciences - Lab Session 3 - Professor Daniel Martin Katz
1. Introduction to Computing
for Complex Systems
(Lab Session 3)
daniel martin katz
illinois institute of technology
chicago kent college of law
@computationaldanielmartinkatz.com computationallegalstudies.com
3. Goals for Today
Finish Exploration of the
Forest Fire Model
Begin exploration of the
Schelling Segregation Model
4. Every item in our Model is:
Important Principles from
Our Last Session
(1) Defined within the Model
(2) Is a Primitive that is defined
in the Netlogo Dictionary
OR
(remember we can think of primitives
as the raw materials of models)
(such as in Globals, Breeds
or in a subroutine)
20. 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
21. In what sense is this model random?
Thinking conceptually
about the model procedures
Placement of the patches
subject to the selected density level
26. 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
35. (a) we are asking “fires”
The ‘To Go’ Procedure
(b) to ask their 4 neighbors
(c) the 4 neighbors that are green
(d) to run the “ignite” protocol
(e) and then set their breed to embers
(f) now run the “fade-embers” protocol
38. The ‘To Go’ Procedure
When is this finally going to halt?
It is a forever button which can be
halted using “STOP”
“STOP” is triggered when the
“if” condition is satisfied
40. Extensions of The
Forest Fire Model
What are the actual dynamics that
generate and sustain forest fires?
What else could we incorporate
into this model?
41. A Non-Exhaustive List
Differential Levels of Moisture
Variable Terrain (Rivers, etc.)
Prior Interventions (Firewalls, etc)
Wind and other Weather Patterns
44. different forms of implementation
may impact the results
Implementation Matters
different forms of implementation may
be more qualitatively appropriate
sophistication regarding implementation
allows you to be a more critical
consumer of scholarship
47. Neighbors and
Neighbors4
neighbors
(think of
this as the
8 neighbors)
what did the
implementer of
the model decide?
neighbors4
decided that the
fire could not move
diagonally
this is probably
not qualitatively
reasonable
48. Step 1: map the dependancies
Step 2: learn the syntax and
functionality for all
unknown primitives
Protocol to Decode
3rd Party Implementation
Step 3: read each line of code and
determine what it doing
53. Step 4: sketch a procedures map
that follows the chronology
of your program
There is one additional step that
often proves useful
Protocol to Decode
3rd Party Implementation
Particularly when you are writing a
model from scratch
54. Very Rough
Sketch of the Fire
Procedures Map
(1)
(2)
(1)(a)(i)
(1)(a)
(1)(a)(ii)
(1)(b)
the point is just to aid in
your understanding
(2)(a)
(2)(a)(i)
(2)(a)(i)(I)
(2)(b)
(2)(b)(i)
(3) - End
Loop Until “if”
Condition is met
55. The Value for Global Must Get “Set”
Somewhere in the Model Procedures
Globals -- one other note
79. Learn the Syntax and
Functionality for all
unknown Primitives
(starting with “to setup”)
80. Again this is the conditional “if” statement
It is relying upon “number”
Is number a netlogo primitive?
81. It is the name of the slider
How could I rename this “totalagents”?
Take 5 minutes and Try to Figure it out
82. (1) Right Click (ctrl + Click on Mac)
on the “number” slider
(2) change the
global variable
name from “number”
to “totalagents”
Modifying the name
(or values) of a Slider
83. Modifying the name
(or values) of a Slider
Notice the
error Message
Must Change all
instances from
“number” to
“totalagents”
Then double
check by hitting
the “check”
Button
84. We have learned a small exception to our rule
Revised Rule --> everything in the model:
(1) defined somewhere in the code
(2) is a primitive
(3) it is something like a slider
85. What is this doing in plain english?
clear everything
if the end user selects a slider value that
exceeds the number of patches
tell that end user to modify and try again
86.
87. (1) Close Netlogo
(2) Discard the Changes
(3) Restart the Segregation model
Quick Reset
88. Open the Schelling
Segregation Model
Delete all
procedures except
those shown to left
What is has this
done to the model?
<Only Red Turtles>
<“Go” button is red>
89. What is this doing in plain english?
asks all of the patches
to randomly “sprout” 1 turtle per patch
and make that turtle color = red
90. What is this doing in plain english?
now take half of those turtles
and set turtle color = green
91. We Need to see
What “update-
varables” is
Actually Doing
92. Here we are going to “set” some of our
“turtles-own” variables
93. “Set” the Turtles-own Variable “similar-nearby”
to the count of “turtles-on” neighbors (8 of them)
but only those with color = my color
94. “Set” the Turtles-own Variable “similar-nearby”
to the count of “turtles-on” neighbors (8 of them)
but only those with color = not my color
95. Take a look at what is happening here
The “happy?” condition is going to be important
involves an agent by agent comparison of the
spread between “similarity-wanted” & “similar-
nearby”