icpsr - complex systems models in the social sciences - lab session 3 - professor daniel martin katz
DESCRIPTION
TRANSCRIPT
![Page 1: ICPSR - Complex Systems Models in the Social Sciences - Lab Session 3 - Professor Daniel Martin Katz](https://reader038.vdocuments.mx/reader038/viewer/2022110115/548bb66bb479592d178b4b7b/html5/thumbnails/1.jpg)
Introduction to Computing for Complex Systems
(Lab Session 3)
Daniel Martin KatzMichigan State University
College of Law
![Page 2: ICPSR - Complex Systems Models in the Social Sciences - Lab Session 3 - Professor Daniel Martin Katz](https://reader038.vdocuments.mx/reader038/viewer/2022110115/548bb66bb479592d178b4b7b/html5/thumbnails/2.jpg)
A Few Books Worth Considering
![Page 3: ICPSR - Complex Systems Models in the Social Sciences - Lab Session 3 - Professor Daniel Martin Katz](https://reader038.vdocuments.mx/reader038/viewer/2022110115/548bb66bb479592d178b4b7b/html5/thumbnails/3.jpg)
Goals for Today
Finish Exploration of the Forest Fire Model
Begin exploration of theSchelling Segregation Model
![Page 4: ICPSR - Complex Systems Models in the Social Sciences - Lab Session 3 - Professor Daniel Martin Katz](https://reader038.vdocuments.mx/reader038/viewer/2022110115/548bb66bb479592d178b4b7b/html5/thumbnails/4.jpg)
Every item in our Model is:
Important Principles fromOur 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)
![Page 5: ICPSR - Complex Systems Models in the Social Sciences - Lab Session 3 - Professor Daniel Martin Katz](https://reader038.vdocuments.mx/reader038/viewer/2022110115/548bb66bb479592d178b4b7b/html5/thumbnails/5.jpg)
Exploring the Forest Fire Model
http://ccl.northwestern.edu/netlogo/models/Fire
(CONDT.)
![Page 6: ICPSR - Complex Systems Models in the Social Sciences - Lab Session 3 - Professor Daniel Martin Katz](https://reader038.vdocuments.mx/reader038/viewer/2022110115/548bb66bb479592d178b4b7b/html5/thumbnails/6.jpg)
The Forest Fire Model
![Page 7: ICPSR - Complex Systems Models in the Social Sciences - Lab Session 3 - Professor Daniel Martin Katz](https://reader038.vdocuments.mx/reader038/viewer/2022110115/548bb66bb479592d178b4b7b/html5/thumbnails/7.jpg)
The Forest Fire Model
![Page 8: ICPSR - Complex Systems Models in the Social Sciences - Lab Session 3 - Professor Daniel Martin Katz](https://reader038.vdocuments.mx/reader038/viewer/2022110115/548bb66bb479592d178b4b7b/html5/thumbnails/8.jpg)
3-D Forest Fire Model
![Page 9: ICPSR - Complex Systems Models in the Social Sciences - Lab Session 3 - Professor Daniel Martin Katz](https://reader038.vdocuments.mx/reader038/viewer/2022110115/548bb66bb479592d178b4b7b/html5/thumbnails/9.jpg)
(1) Modify the Color of the Forest to Blue
(2) Make the Fire Move North to South Instead of West to East
How Did We Do?
![Page 10: ICPSR - Complex Systems Models in the Social Sciences - Lab Session 3 - Professor Daniel Martin Katz](https://reader038.vdocuments.mx/reader038/viewer/2022110115/548bb66bb479592d178b4b7b/html5/thumbnails/10.jpg)
Modify the Color of the Forest to Blue
![Page 11: ICPSR - Complex Systems Models in the Social Sciences - Lab Session 3 - Professor Daniel Martin Katz](https://reader038.vdocuments.mx/reader038/viewer/2022110115/548bb66bb479592d178b4b7b/html5/thumbnails/11.jpg)
What Elements of the Code Do We Modify?
![Page 12: ICPSR - Complex Systems Models in the Social Sciences - Lab Session 3 - Professor Daniel Martin Katz](https://reader038.vdocuments.mx/reader038/viewer/2022110115/548bb66bb479592d178b4b7b/html5/thumbnails/12.jpg)
The Forest Fire Model
Procedures
![Page 13: ICPSR - Complex Systems Models in the Social Sciences - Lab Session 3 - Professor Daniel Martin Katz](https://reader038.vdocuments.mx/reader038/viewer/2022110115/548bb66bb479592d178b4b7b/html5/thumbnails/13.jpg)
The Forest Fire Model
Procedures
![Page 14: ICPSR - Complex Systems Models in the Social Sciences - Lab Session 3 - Professor Daniel Martin Katz](https://reader038.vdocuments.mx/reader038/viewer/2022110115/548bb66bb479592d178b4b7b/html5/thumbnails/14.jpg)
Make the Fire Move North to South Instead of West to East
![Page 15: ICPSR - Complex Systems Models in the Social Sciences - Lab Session 3 - Professor Daniel Martin Katz](https://reader038.vdocuments.mx/reader038/viewer/2022110115/548bb66bb479592d178b4b7b/html5/thumbnails/15.jpg)
Make the Fire Move North to South Instead of West to East
![Page 16: ICPSR - Complex Systems Models in the Social Sciences - Lab Session 3 - Professor Daniel Martin Katz](https://reader038.vdocuments.mx/reader038/viewer/2022110115/548bb66bb479592d178b4b7b/html5/thumbnails/16.jpg)
What Elements of the Code Do We Modify?
![Page 17: ICPSR - Complex Systems Models in the Social Sciences - Lab Session 3 - Professor Daniel Martin Katz](https://reader038.vdocuments.mx/reader038/viewer/2022110115/548bb66bb479592d178b4b7b/html5/thumbnails/17.jpg)
The Forest Fire Model
Procedures
![Page 18: ICPSR - Complex Systems Models in the Social Sciences - Lab Session 3 - Professor Daniel Martin Katz](https://reader038.vdocuments.mx/reader038/viewer/2022110115/548bb66bb479592d178b4b7b/html5/thumbnails/18.jpg)
The Forest Fire Model
Procedures
Try this Instead:
![Page 19: ICPSR - Complex Systems Models in the Social Sciences - Lab Session 3 - Professor Daniel Martin Katz](https://reader038.vdocuments.mx/reader038/viewer/2022110115/548bb66bb479592d178b4b7b/html5/thumbnails/19.jpg)
![Page 20: ICPSR - Complex Systems Models in the Social Sciences - Lab Session 3 - Professor Daniel Martin Katz](https://reader038.vdocuments.mx/reader038/viewer/2022110115/548bb66bb479592d178b4b7b/html5/thumbnails/20.jpg)
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
![Page 21: ICPSR - Complex Systems Models in the Social Sciences - Lab Session 3 - Professor Daniel Martin Katz](https://reader038.vdocuments.mx/reader038/viewer/2022110115/548bb66bb479592d178b4b7b/html5/thumbnails/21.jpg)
In what sense is this model random?
Thinking conceptually about the model procedures
Placement of the patches
subject to the selected density level
![Page 22: ICPSR - Complex Systems Models in the Social Sciences - Lab Session 3 - Professor Daniel Martin Katz](https://reader038.vdocuments.mx/reader038/viewer/2022110115/548bb66bb479592d178b4b7b/html5/thumbnails/22.jpg)
Watch the Model in 3D
![Page 23: ICPSR - Complex Systems Models in the Social Sciences - Lab Session 3 - Professor Daniel Martin Katz](https://reader038.vdocuments.mx/reader038/viewer/2022110115/548bb66bb479592d178b4b7b/html5/thumbnails/23.jpg)
Watch the Model in 3D
![Page 24: ICPSR - Complex Systems Models in the Social Sciences - Lab Session 3 - Professor Daniel Martin Katz](https://reader038.vdocuments.mx/reader038/viewer/2022110115/548bb66bb479592d178b4b7b/html5/thumbnails/24.jpg)
Watch the Model in 3D
![Page 25: ICPSR - Complex Systems Models in the Social Sciences - Lab Session 3 - Professor Daniel Martin Katz](https://reader038.vdocuments.mx/reader038/viewer/2022110115/548bb66bb479592d178b4b7b/html5/thumbnails/25.jpg)
Watch the Model in 3D
![Page 26: ICPSR - Complex Systems Models in the Social Sciences - Lab Session 3 - Professor Daniel Martin Katz](https://reader038.vdocuments.mx/reader038/viewer/2022110115/548bb66bb479592d178b4b7b/html5/thumbnails/26.jpg)
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
![Page 27: ICPSR - Complex Systems Models in the Social Sciences - Lab Session 3 - Professor Daniel Martin Katz](https://reader038.vdocuments.mx/reader038/viewer/2022110115/548bb66bb479592d178b4b7b/html5/thumbnails/27.jpg)
Back to the Forest Fire
Model Procedures
![Page 28: ICPSR - Complex Systems Models in the Social Sciences - Lab Session 3 - Professor Daniel Martin Katz](https://reader038.vdocuments.mx/reader038/viewer/2022110115/548bb66bb479592d178b4b7b/html5/thumbnails/28.jpg)
relies upon:if not any? stopask fires ask neighbors4fade-embersignitetick
The ‘To Go’ Procedure
![Page 29: ICPSR - Complex Systems Models in the Social Sciences - Lab Session 3 - Professor Daniel Martin Katz](https://reader038.vdocuments.mx/reader038/viewer/2022110115/548bb66bb479592d178b4b7b/html5/thumbnails/29.jpg)
if is a condition and you can think of it as:
if x condition is met than do action y
(otherwise move on to the next line)
The ‘To Go’ Procedure
![Page 30: ICPSR - Complex Systems Models in the Social Sciences - Lab Session 3 - Professor Daniel Martin Katz](https://reader038.vdocuments.mx/reader038/viewer/2022110115/548bb66bb479592d178b4b7b/html5/thumbnails/30.jpg)
This is going to kill the model if
condition is achieved
vs.
Forever Button
Once-only Button
The ‘To Go’ Procedure
![Page 31: ICPSR - Complex Systems Models in the Social Sciences - Lab Session 3 - Professor Daniel Martin Katz](https://reader038.vdocuments.mx/reader038/viewer/2022110115/548bb66bb479592d178b4b7b/html5/thumbnails/31.jpg)
Why is this Arguably the KEY piece of code?
What does it mean in plain english?
The ‘To Go’ Procedure
![Page 32: ICPSR - Complex Systems Models in the Social Sciences - Lab Session 3 - Professor Daniel Martin Katz](https://reader038.vdocuments.mx/reader038/viewer/2022110115/548bb66bb479592d178b4b7b/html5/thumbnails/32.jpg)
What is neighbors4?
Remember our basic rule:
The ‘To Go’ Procedure
It is defined within the program
or it is one of the netlogo primitives
![Page 33: ICPSR - Complex Systems Models in the Social Sciences - Lab Session 3 - Professor Daniel Martin Katz](https://reader038.vdocuments.mx/reader038/viewer/2022110115/548bb66bb479592d178b4b7b/html5/thumbnails/33.jpg)
The ‘To Go’ Procedure
![Page 34: ICPSR - Complex Systems Models in the Social Sciences - Lab Session 3 - Professor Daniel Martin Katz](https://reader038.vdocuments.mx/reader038/viewer/2022110115/548bb66bb479592d178b4b7b/html5/thumbnails/34.jpg)
Neighbors and Neighbors4
turtle turtle
neighbors4 neighbors(think of
this as the 8 neighbors)
turtle
![Page 35: ICPSR - Complex Systems Models in the Social Sciences - Lab Session 3 - Professor Daniel Martin Katz](https://reader038.vdocuments.mx/reader038/viewer/2022110115/548bb66bb479592d178b4b7b/html5/thumbnails/35.jpg)
(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
![Page 36: ICPSR - Complex Systems Models in the Social Sciences - Lab Session 3 - Professor Daniel Martin Katz](https://reader038.vdocuments.mx/reader038/viewer/2022110115/548bb66bb479592d178b4b7b/html5/thumbnails/36.jpg)
The ‘To Go’ Procedure
![Page 37: ICPSR - Complex Systems Models in the Social Sciences - Lab Session 3 - Professor Daniel Martin Katz](https://reader038.vdocuments.mx/reader038/viewer/2022110115/548bb66bb479592d178b4b7b/html5/thumbnails/37.jpg)
The ‘To Go’ Procedure
![Page 38: ICPSR - Complex Systems Models in the Social Sciences - Lab Session 3 - Professor Daniel Martin Katz](https://reader038.vdocuments.mx/reader038/viewer/2022110115/548bb66bb479592d178b4b7b/html5/thumbnails/38.jpg)
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
![Page 39: ICPSR - Complex Systems Models in the Social Sciences - Lab Session 3 - Professor Daniel Martin Katz](https://reader038.vdocuments.mx/reader038/viewer/2022110115/548bb66bb479592d178b4b7b/html5/thumbnails/39.jpg)
Lets Discuss Some Extensions of The Forest Fire Model
![Page 40: ICPSR - Complex Systems Models in the Social Sciences - Lab Session 3 - Professor Daniel Martin Katz](https://reader038.vdocuments.mx/reader038/viewer/2022110115/548bb66bb479592d178b4b7b/html5/thumbnails/40.jpg)
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?
![Page 41: ICPSR - Complex Systems Models in the Social Sciences - Lab Session 3 - Professor Daniel Martin Katz](https://reader038.vdocuments.mx/reader038/viewer/2022110115/548bb66bb479592d178b4b7b/html5/thumbnails/41.jpg)
A Non-Exhaustive List
Differential Levels of Moisture
Variable Terrain (Rivers, etc.)
Prior Interventions (Firewalls, etc)
Wind and other Weather Patterns
![Page 42: ICPSR - Complex Systems Models in the Social Sciences - Lab Session 3 - Professor Daniel Martin Katz](https://reader038.vdocuments.mx/reader038/viewer/2022110115/548bb66bb479592d178b4b7b/html5/thumbnails/42.jpg)
Some of the Existing Extensions
![Page 43: ICPSR - Complex Systems Models in the Social Sciences - Lab Session 3 - Professor Daniel Martin Katz](https://reader038.vdocuments.mx/reader038/viewer/2022110115/548bb66bb479592d178b4b7b/html5/thumbnails/43.jpg)
![Page 44: ICPSR - Complex Systems Models in the Social Sciences - Lab Session 3 - Professor Daniel Martin Katz](https://reader038.vdocuments.mx/reader038/viewer/2022110115/548bb66bb479592d178b4b7b/html5/thumbnails/44.jpg)
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
![Page 45: ICPSR - Complex Systems Models in the Social Sciences - Lab Session 3 - Professor Daniel Martin Katz](https://reader038.vdocuments.mx/reader038/viewer/2022110115/548bb66bb479592d178b4b7b/html5/thumbnails/45.jpg)
the neighbors4 example
![Page 46: ICPSR - Complex Systems Models in the Social Sciences - Lab Session 3 - Professor Daniel Martin Katz](https://reader038.vdocuments.mx/reader038/viewer/2022110115/548bb66bb479592d178b4b7b/html5/thumbnails/46.jpg)
Neighbors and Neighbors4
turtle turtle
neighbors4 neighbors(think of
this as the 8 neighbors)
turtle
![Page 47: ICPSR - Complex Systems Models in the Social Sciences - Lab Session 3 - Professor Daniel Martin Katz](https://reader038.vdocuments.mx/reader038/viewer/2022110115/548bb66bb479592d178b4b7b/html5/thumbnails/47.jpg)
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
![Page 48: ICPSR - Complex Systems Models in the Social Sciences - Lab Session 3 - Professor Daniel Martin Katz](https://reader038.vdocuments.mx/reader038/viewer/2022110115/548bb66bb479592d178b4b7b/html5/thumbnails/48.jpg)
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
![Page 49: ICPSR - Complex Systems Models in the Social Sciences - Lab Session 3 - Professor Daniel Martin Katz](https://reader038.vdocuments.mx/reader038/viewer/2022110115/548bb66bb479592d178b4b7b/html5/thumbnails/49.jpg)
![Page 50: ICPSR - Complex Systems Models in the Social Sciences - Lab Session 3 - Professor Daniel Martin Katz](https://reader038.vdocuments.mx/reader038/viewer/2022110115/548bb66bb479592d178b4b7b/html5/thumbnails/50.jpg)
Mapping of the Code
![Page 51: ICPSR - Complex Systems Models in the Social Sciences - Lab Session 3 - Professor Daniel Martin Katz](https://reader038.vdocuments.mx/reader038/viewer/2022110115/548bb66bb479592d178b4b7b/html5/thumbnails/51.jpg)
just some examples of primitives from the dictionary that we have already learned
Protocol to Decode 3rd Party Implementation
![Page 52: ICPSR - Complex Systems Models in the Social Sciences - Lab Session 3 - Professor Daniel Martin Katz](https://reader038.vdocuments.mx/reader038/viewer/2022110115/548bb66bb479592d178b4b7b/html5/thumbnails/52.jpg)
Next We Went Line by Line Through the Code
![Page 53: ICPSR - Complex Systems Models in the Social Sciences - Lab Session 3 - Professor Daniel Martin Katz](https://reader038.vdocuments.mx/reader038/viewer/2022110115/548bb66bb479592d178b4b7b/html5/thumbnails/53.jpg)
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
![Page 54: ICPSR - Complex Systems Models in the Social Sciences - Lab Session 3 - Professor Daniel Martin Katz](https://reader038.vdocuments.mx/reader038/viewer/2022110115/548bb66bb479592d178b4b7b/html5/thumbnails/54.jpg)
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
![Page 55: ICPSR - Complex Systems Models in the Social Sciences - Lab Session 3 - Professor Daniel Martin Katz](https://reader038.vdocuments.mx/reader038/viewer/2022110115/548bb66bb479592d178b4b7b/html5/thumbnails/55.jpg)
The Value for Global Must Get “Set” Somewhere in the Model Procedures
Globals -- one other note
![Page 56: ICPSR - Complex Systems Models in the Social Sciences - Lab Session 3 - Professor Daniel Martin Katz](https://reader038.vdocuments.mx/reader038/viewer/2022110115/548bb66bb479592d178b4b7b/html5/thumbnails/56.jpg)
![Page 57: ICPSR - Complex Systems Models in the Social Sciences - Lab Session 3 - Professor Daniel Martin Katz](https://reader038.vdocuments.mx/reader038/viewer/2022110115/548bb66bb479592d178b4b7b/html5/thumbnails/57.jpg)
Mapping of the Code
![Page 58: ICPSR - Complex Systems Models in the Social Sciences - Lab Session 3 - Professor Daniel Martin Katz](https://reader038.vdocuments.mx/reader038/viewer/2022110115/548bb66bb479592d178b4b7b/html5/thumbnails/58.jpg)
![Page 59: ICPSR - Complex Systems Models in the Social Sciences - Lab Session 3 - Professor Daniel Martin Katz](https://reader038.vdocuments.mx/reader038/viewer/2022110115/548bb66bb479592d178b4b7b/html5/thumbnails/59.jpg)
Introduction to theSchelling
Segregation Model
![Page 60: ICPSR - Complex Systems Models in the Social Sciences - Lab Session 3 - Professor Daniel Martin Katz](https://reader038.vdocuments.mx/reader038/viewer/2022110115/548bb66bb479592d178b4b7b/html5/thumbnails/60.jpg)
What Does this Title Mean?
What is the micro to macro disconnect?
relationship to the ecological inference
fallacy?
![Page 61: ICPSR - Complex Systems Models in the Social Sciences - Lab Session 3 - Professor Daniel Martin Katz](https://reader038.vdocuments.mx/reader038/viewer/2022110115/548bb66bb479592d178b4b7b/html5/thumbnails/61.jpg)
Schelling Social Segregation Model
![Page 62: ICPSR - Complex Systems Models in the Social Sciences - Lab Session 3 - Professor Daniel Martin Katz](https://reader038.vdocuments.mx/reader038/viewer/2022110115/548bb66bb479592d178b4b7b/html5/thumbnails/62.jpg)
Schelling Social Segregation Model
![Page 63: ICPSR - Complex Systems Models in the Social Sciences - Lab Session 3 - Professor Daniel Martin Katz](https://reader038.vdocuments.mx/reader038/viewer/2022110115/548bb66bb479592d178b4b7b/html5/thumbnails/63.jpg)
Schelling Social Segregation Model
![Page 64: ICPSR - Complex Systems Models in the Social Sciences - Lab Session 3 - Professor Daniel Martin Katz](https://reader038.vdocuments.mx/reader038/viewer/2022110115/548bb66bb479592d178b4b7b/html5/thumbnails/64.jpg)
Schelling Social Segregation Model
![Page 65: ICPSR - Complex Systems Models in the Social Sciences - Lab Session 3 - Professor Daniel Martin Katz](https://reader038.vdocuments.mx/reader038/viewer/2022110115/548bb66bb479592d178b4b7b/html5/thumbnails/65.jpg)
Schelling Social Segregation Model
![Page 66: ICPSR - Complex Systems Models in the Social Sciences - Lab Session 3 - Professor Daniel Martin Katz](https://reader038.vdocuments.mx/reader038/viewer/2022110115/548bb66bb479592d178b4b7b/html5/thumbnails/66.jpg)
Schelling Social Segregation Model
![Page 67: ICPSR - Complex Systems Models in the Social Sciences - Lab Session 3 - Professor Daniel Martin Katz](https://reader038.vdocuments.mx/reader038/viewer/2022110115/548bb66bb479592d178b4b7b/html5/thumbnails/67.jpg)
Schelling Social Segregation Model
versus
note: stopped model before % unhappy = 0
![Page 68: ICPSR - Complex Systems Models in the Social Sciences - Lab Session 3 - Professor Daniel Martin Katz](https://reader038.vdocuments.mx/reader038/viewer/2022110115/548bb66bb479592d178b4b7b/html5/thumbnails/68.jpg)
Schelling Social Segregation Model
Test these Parameters and report
Results
![Page 69: ICPSR - Complex Systems Models in the Social Sciences - Lab Session 3 - Professor Daniel Martin Katz](https://reader038.vdocuments.mx/reader038/viewer/2022110115/548bb66bb479592d178b4b7b/html5/thumbnails/69.jpg)
Schelling Social Segregation Model
![Page 70: ICPSR - Complex Systems Models in the Social Sciences - Lab Session 3 - Professor Daniel Martin Katz](https://reader038.vdocuments.mx/reader038/viewer/2022110115/548bb66bb479592d178b4b7b/html5/thumbnails/70.jpg)
Schelling Social Segregation Model
![Page 71: ICPSR - Complex Systems Models in the Social Sciences - Lab Session 3 - Professor Daniel Martin Katz](https://reader038.vdocuments.mx/reader038/viewer/2022110115/548bb66bb479592d178b4b7b/html5/thumbnails/71.jpg)
Schelling Social Segregation Model
![Page 72: ICPSR - Complex Systems Models in the Social Sciences - Lab Session 3 - Professor Daniel Martin Katz](https://reader038.vdocuments.mx/reader038/viewer/2022110115/548bb66bb479592d178b4b7b/html5/thumbnails/72.jpg)
Schelling Social Segregation Model
versus
![Page 73: ICPSR - Complex Systems Models in the Social Sciences - Lab Session 3 - Professor Daniel Martin Katz](https://reader038.vdocuments.mx/reader038/viewer/2022110115/548bb66bb479592d178b4b7b/html5/thumbnails/73.jpg)
![Page 74: ICPSR - Complex Systems Models in the Social Sciences - Lab Session 3 - Professor Daniel Martin Katz](https://reader038.vdocuments.mx/reader038/viewer/2022110115/548bb66bb479592d178b4b7b/html5/thumbnails/74.jpg)
Schelling Social Segregation Model
![Page 75: ICPSR - Complex Systems Models in the Social Sciences - Lab Session 3 - Professor Daniel Martin Katz](https://reader038.vdocuments.mx/reader038/viewer/2022110115/548bb66bb479592d178b4b7b/html5/thumbnails/75.jpg)
the full model
![Page 76: ICPSR - Complex Systems Models in the Social Sciences - Lab Session 3 - Professor Daniel Martin Katz](https://reader038.vdocuments.mx/reader038/viewer/2022110115/548bb66bb479592d178b4b7b/html5/thumbnails/76.jpg)
![Page 77: ICPSR - Complex Systems Models in the Social Sciences - Lab Session 3 - Professor Daniel Martin Katz](https://reader038.vdocuments.mx/reader038/viewer/2022110115/548bb66bb479592d178b4b7b/html5/thumbnails/77.jpg)
Print This and Draw the Connections for a Full Map
of the Schelling Code
![Page 78: ICPSR - Complex Systems Models in the Social Sciences - Lab Session 3 - Professor Daniel Martin Katz](https://reader038.vdocuments.mx/reader038/viewer/2022110115/548bb66bb479592d178b4b7b/html5/thumbnails/78.jpg)
Mapping of the Schelling Code(%-similar-wanted is a slider)
![Page 79: ICPSR - Complex Systems Models in the Social Sciences - Lab Session 3 - Professor Daniel Martin Katz](https://reader038.vdocuments.mx/reader038/viewer/2022110115/548bb66bb479592d178b4b7b/html5/thumbnails/79.jpg)
Learn the Syntax and Functionality for all unknown Primitives
(starting with “to setup”)
![Page 80: ICPSR - Complex Systems Models in the Social Sciences - Lab Session 3 - Professor Daniel Martin Katz](https://reader038.vdocuments.mx/reader038/viewer/2022110115/548bb66bb479592d178b4b7b/html5/thumbnails/80.jpg)
Again this is the conditional “if” statement
It is relying upon “number”
Is number a netlogo primitive?
![Page 81: ICPSR - Complex Systems Models in the Social Sciences - Lab Session 3 - Professor Daniel Martin Katz](https://reader038.vdocuments.mx/reader038/viewer/2022110115/548bb66bb479592d178b4b7b/html5/thumbnails/81.jpg)
It is the name of the slider
How could I rename this “totalagents”?
Take 5 minutes and Try to Figure it out
![Page 82: ICPSR - Complex Systems Models in the Social Sciences - Lab Session 3 - Professor Daniel Martin Katz](https://reader038.vdocuments.mx/reader038/viewer/2022110115/548bb66bb479592d178b4b7b/html5/thumbnails/82.jpg)
(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
![Page 83: ICPSR - Complex Systems Models in the Social Sciences - Lab Session 3 - Professor Daniel Martin Katz](https://reader038.vdocuments.mx/reader038/viewer/2022110115/548bb66bb479592d178b4b7b/html5/thumbnails/83.jpg)
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
![Page 84: ICPSR - Complex Systems Models in the Social Sciences - Lab Session 3 - Professor Daniel Martin Katz](https://reader038.vdocuments.mx/reader038/viewer/2022110115/548bb66bb479592d178b4b7b/html5/thumbnails/84.jpg)
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
![Page 85: ICPSR - Complex Systems Models in the Social Sciences - Lab Session 3 - Professor Daniel Martin Katz](https://reader038.vdocuments.mx/reader038/viewer/2022110115/548bb66bb479592d178b4b7b/html5/thumbnails/85.jpg)
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
![Page 86: ICPSR - Complex Systems Models in the Social Sciences - Lab Session 3 - Professor Daniel Martin Katz](https://reader038.vdocuments.mx/reader038/viewer/2022110115/548bb66bb479592d178b4b7b/html5/thumbnails/86.jpg)
![Page 87: ICPSR - Complex Systems Models in the Social Sciences - Lab Session 3 - Professor Daniel Martin Katz](https://reader038.vdocuments.mx/reader038/viewer/2022110115/548bb66bb479592d178b4b7b/html5/thumbnails/87.jpg)
(1) Close Netlogo
(2) Discard the Changes
(3) Restart the Segregation model
Quick Reset
![Page 88: ICPSR - Complex Systems Models in the Social Sciences - Lab Session 3 - Professor Daniel Martin Katz](https://reader038.vdocuments.mx/reader038/viewer/2022110115/548bb66bb479592d178b4b7b/html5/thumbnails/88.jpg)
Open the SchellingSegregation Model
Delete all procedures except those shown to left
What is has this done to the model?
<Only Red Turtles>
<“Go” button is red>
![Page 89: ICPSR - Complex Systems Models in the Social Sciences - Lab Session 3 - Professor Daniel Martin Katz](https://reader038.vdocuments.mx/reader038/viewer/2022110115/548bb66bb479592d178b4b7b/html5/thumbnails/89.jpg)
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
![Page 90: ICPSR - Complex Systems Models in the Social Sciences - Lab Session 3 - Professor Daniel Martin Katz](https://reader038.vdocuments.mx/reader038/viewer/2022110115/548bb66bb479592d178b4b7b/html5/thumbnails/90.jpg)
What is this doing in plain english?
now take half of those turtles
and set turtle color = green
![Page 91: ICPSR - Complex Systems Models in the Social Sciences - Lab Session 3 - Professor Daniel Martin Katz](https://reader038.vdocuments.mx/reader038/viewer/2022110115/548bb66bb479592d178b4b7b/html5/thumbnails/91.jpg)
We Need to see What “update-varables” is Actually Doing
![Page 92: ICPSR - Complex Systems Models in the Social Sciences - Lab Session 3 - Professor Daniel Martin Katz](https://reader038.vdocuments.mx/reader038/viewer/2022110115/548bb66bb479592d178b4b7b/html5/thumbnails/92.jpg)
Here we are going to “set” some of our “turtles-own” variables
![Page 93: ICPSR - Complex Systems Models in the Social Sciences - Lab Session 3 - Professor Daniel Martin Katz](https://reader038.vdocuments.mx/reader038/viewer/2022110115/548bb66bb479592d178b4b7b/html5/thumbnails/93.jpg)
“Set” the Turtles-own Variable “similar-nearby”
to the count of “turtles-on” neighbors (8 of them)
but only those with color = my color
![Page 94: ICPSR - Complex Systems Models in the Social Sciences - Lab Session 3 - Professor Daniel Martin Katz](https://reader038.vdocuments.mx/reader038/viewer/2022110115/548bb66bb479592d178b4b7b/html5/thumbnails/94.jpg)
“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
![Page 95: ICPSR - Complex Systems Models in the Social Sciences - Lab Session 3 - Professor Daniel Martin Katz](https://reader038.vdocuments.mx/reader038/viewer/2022110115/548bb66bb479592d178b4b7b/html5/thumbnails/95.jpg)
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”