Ce diaporama a bien été signalé.
Nous utilisons votre profil LinkedIn et vos données d’activité pour vous proposer des publicités personnalisées et pertinentes. Vous pouvez changer vos préférences de publicités à tout moment.
Introduction to Computing
for Complex Systems
(Lab Session 4)
daniel martin katz
illinois institute of technology
chicago ...
Take a Look at
this Article
from the
Economist
(July 22, 2010)
Agent Based
Models and
Positive
Economic
Theory
Refer Back ...
Schelling Social Segregation Model
the full
model
Print This and Draw the
Connections for a Full Map
of the Schelling Code
Mapping of the
Schelling Code
(%-similar-wanted is a slider)
We Need to see
What “update-
varables” is
Actually Doing
Here we are going to “set” some of our
“turtles-own” variables
“Set” the Turtles-own Variable “similar-nearby”
to the count of “turtles-on” neighbors (8 of them)
but only those with col...
“Set” the Turtles-own Variable “other-nearby”
to the count of “turtles-on” neighbors (8 of them)
but only those with color...
Take a look at what is happening here
The “happy?” condition is going to be important
involves an agent by agent compariso...
Now Lets Look at “Update-globals”
It involves “lets” and “sets”
uses the globals but also some of the
turtles-own variables
I will allow you to review this on your own
However, consider the syntax of “sum”
(1) Right Click
(ctrl + Click on Mac)
on the “percent-
similar” plot
(2) This will appear
and will allow for
various modif...
We now consider the “to go”
portion of the code
lets reduce the “to go” procedures
the “to go” portion
of the code
above are the major new elements
remember conceptually ...
Again, we have the “if”
the “to go” portion
of the code
The “to go” button with
stop when all turtles
are “happy?”
Here is...
create an agentset of “not happy?” turtles
the movement portion
of the code
For that agentset we run the “find-new-spot”
p...
the movement portion
of the code
the movement portion
of the code
the movement portion
of the code
Notice that it is going to re-run the “find-new-spot”
If the “if” condition is met
In oth...
Thinking about Extensions
to the Schelling Model
This is closer to a “representative agent” model
Agents are homogenous in...
Thinking about Extensions
to the Schelling Model
spatial considerations
The 8 neighbors might not be how
individuals actua...
Thinking about Extensions
to the Schelling Model
structural considerations
the model could encode certain barriers
to entr...
An Exercise
Start With the Default
Implementation of
Social Segregation
Imagine that you are
interested in
developing a ce...
Modify the Code as
Needed in Order to
Produce The Closest
Possible Model Run
to the Camouflage
Note: this involves 4
Group...
Send Me Your Best
Effort
daniel.martin.katz@gmail.com
I will announce the
Winner
Simple Birth Rates
Simple Birth Rates
Simple Birth Rates
Simple Birth Rates
take a few minutes and play around with the model
consider the questions offered above
Thinking Conceptually:
Simple Birth Rates
What Does the Turtle Movement Add to the Model?
Are Turtles Added to the Model?
...
Simple Birth Rates:
Exploring the Code
Step 1: map the dependancies
Step 2: learn the syntax and
functionality for all
unknown primitives
Step 3: read each line ...
Simple
Birth
Rates
Experiment
Basic Setup
Simple Birth Rates
Death
Plots
Reproduction
Movement
Simple Birth Rates
“To Setup” Procedures
Simple
Birth
Rates
“To Go”
Procedures
Simple Birth Rates
Turtle Movement
Procedures
Simple Birth Rates
Please
Review
“ifelse”
How does
it work?
Simple Birth Rates
Take a Look
at the
Reproduction
Procedures
Simple Birth Rates
Death
Procedures
Plot
Procedures
Simple Birth Rates
Right Click (ctrl + Click on Mac) on the “run experiment” Button
Simple Birth Rates
forever
button
Notice
observer is
selected
Calls upon the
go-experiment
sub-procedures
Name of
our
Butt...
Simple Birth Rates
Take a look at
this for later in
the week
Automation is really
going to help us
ICPSR - Complex Systems Models in the Social Sciences - Lab Session 4 - Professor Daniel Martin Katz
ICPSR - Complex Systems Models in the Social Sciences - Lab Session 4 - Professor Daniel Martin Katz
ICPSR - Complex Systems Models in the Social Sciences - Lab Session 4 - Professor Daniel Martin Katz
ICPSR - Complex Systems Models in the Social Sciences - Lab Session 4 - Professor Daniel Martin Katz
ICPSR - Complex Systems Models in the Social Sciences - Lab Session 4 - Professor Daniel Martin Katz
ICPSR - Complex Systems Models in the Social Sciences - Lab Session 4 - Professor Daniel Martin Katz
ICPSR - Complex Systems Models in the Social Sciences - Lab Session 4 - Professor Daniel Martin Katz
ICPSR - Complex Systems Models in the Social Sciences - Lab Session 4 - Professor Daniel Martin Katz
ICPSR - Complex Systems Models in the Social Sciences - Lab Session 4 - Professor Daniel Martin Katz
ICPSR - Complex Systems Models in the Social Sciences - Lab Session 4 - Professor Daniel Martin Katz
ICPSR - Complex Systems Models in the Social Sciences - Lab Session 4 - Professor Daniel Martin Katz
ICPSR - Complex Systems Models in the Social Sciences - Lab Session 4 - Professor Daniel Martin Katz
ICPSR - Complex Systems Models in the Social Sciences - Lab Session 4 - Professor Daniel Martin Katz
Prochain SlideShare
Chargement dans…5
×

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

1 065 vues

Publié le

Publié dans : Technologie, Santé & Médecine
  • Soyez le premier à commenter

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

  1. 1. Introduction to Computing for Complex Systems (Lab Session 4) daniel martin katz illinois institute of technology chicago kent college of law @computationaldanielmartinkatz.com computationallegalstudies.com
  2. 2. Take a Look at this Article from the Economist (July 22, 2010) Agent Based Models and Positive Economic Theory Refer Back to my slides about equilibrium and its discontents
  3. 3. Schelling Social Segregation Model
  4. 4. the full model
  5. 5. Print This and Draw the Connections for a Full Map of the Schelling Code
  6. 6. Mapping of the Schelling Code (%-similar-wanted is a slider)
  7. 7. We Need to see What “update- varables” is Actually Doing
  8. 8. Here we are going to “set” some of our “turtles-own” variables
  9. 9. “Set” the Turtles-own Variable “similar-nearby” to the count of “turtles-on” neighbors (8 of them) but only those with color = my color
  10. 10. “Set” the Turtles-own Variable “other-nearby” to the count of “turtles-on” neighbors (8 of them) but only those with color = not my color
  11. 11. 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”
  12. 12. Now Lets Look at “Update-globals” It involves “lets” and “sets” uses the globals but also some of the turtles-own variables
  13. 13. I will allow you to review this on your own However, consider the syntax of “sum”
  14. 14. (1) Right Click (ctrl + Click on Mac) on the “percent- similar” plot (2) This will appear and will allow for various modifications (color, interval, etc.)
  15. 15. We now consider the “to go” portion of the code
  16. 16. lets reduce the “to go” procedures the “to go” portion of the code above are the major new elements remember conceptually the model relies upon movement if a turtle is unhappy
  17. 17. Again, we have the “if” the “to go” portion of the code The “to go” button with stop when all turtles are “happy?” Here is how “Happy?” gets set: model continues to tick until every agent is above the “%-similar-wanted” as set on the slider
  18. 18. create an agentset of “not happy?” turtles the movement portion of the code For that agentset we run the “find-new-spot” procedures We know from the “to go” procedures that this is going to continue to run until the “if” condition is satisfied
  19. 19. the movement portion of the code
  20. 20. the movement portion of the code
  21. 21. the movement portion of the code Notice that it is going to re-run the “find-new-spot” If the “if” condition is met In other words, agents are going to move until they find a open patch then agent will occupy the center of open patch
  22. 22. Thinking about Extensions to the Schelling Model This is closer to a “representative agent” model Agents are homogenous in their %similar-wanted In reality, there is likely variance across agents In other words, comparing across agents there are differential preferences with respect to the %similar-wanted
  23. 23. Thinking about Extensions to the Schelling Model spatial considerations The 8 neighbors might not be how individuals actually make their assessments agents might make choices based upon a wider assessment of the neighborhood there might be different “prices” for different patches (i.e. a simulated housing market)
  24. 24. Thinking about Extensions to the Schelling Model structural considerations the model could encode certain barriers to entry to particular neighborhoods barriers could be highly asymmetric (i.e. red turtles face no barriers and green turtles face high barriers)
  25. 25. An Exercise Start With the Default Implementation of Social Segregation Imagine that you are interested in developing a certain style of integration
  26. 26. Modify the Code as Needed in Order to Produce The Closest Possible Model Run to the Camouflage Note: this involves 4 Groups not 2 Groups Your Goal! Homework Exercise
  27. 27. Send Me Your Best Effort daniel.martin.katz@gmail.com I will announce the Winner
  28. 28. Simple Birth Rates
  29. 29. Simple Birth Rates
  30. 30. Simple Birth Rates
  31. 31. Simple Birth Rates take a few minutes and play around with the model consider the questions offered above
  32. 32. Thinking Conceptually: Simple Birth Rates What Does the Turtle Movement Add to the Model? Are Turtles Added to the Model? and If So How? Are Turtles Removed from the Model? and If So How?
  33. 33. Simple Birth Rates: Exploring the Code
  34. 34. Step 1: map the dependancies Step 2: learn the syntax and functionality for all unknown primitives Step 3: read each line of code and determine what it doing Simple Birth Rates Step 4: sketch a procedures map that follows the chronology of your program At this point it is more Important for you to go though the models line by line on your own using the above protocol
  35. 35. Simple Birth Rates
  36. 36. Experiment Basic Setup Simple Birth Rates Death Plots Reproduction Movement
  37. 37. Simple Birth Rates “To Setup” Procedures
  38. 38. Simple Birth Rates “To Go” Procedures
  39. 39. Simple Birth Rates Turtle Movement Procedures
  40. 40. Simple Birth Rates Please Review “ifelse” How does it work?
  41. 41. Simple Birth Rates Take a Look at the Reproduction Procedures
  42. 42. Simple Birth Rates Death Procedures Plot Procedures
  43. 43. Simple Birth Rates Right Click (ctrl + Click on Mac) on the “run experiment” Button
  44. 44. Simple Birth Rates forever button Notice observer is selected Calls upon the go-experiment sub-procedures Name of our Button
  45. 45. Simple Birth Rates Take a look at this for later in the week Automation is really going to help us

×