Your First Model

EES 4760/5760

Agent-Based & Individual-Based Computational Modeling

Jonathan Gilligan

Class #5: Tues. January 23 2018

Homework

Homework:

  • In the mushroom hunt, were there always 80 red patches?
  • Any questions about modified mushroom hunt model?
  • Let’s talk about ODD exercise.

Writing a model from an ODD

  • Questions about writing a model from Butterfly ODD?
  • Were there things the ODD was unclear about?

Digression on Turtles

Why “Turtles”?

Original Turtle Seymour Papert

Butterfly Model

Enhancing the Butterfly model

patches-own
[ 
  elevation 
  visited? ; question mark means it's a true/false variable
]

to setup
[
  ...
  ask patches [
    set visited? false
    ...
    ]
  ...
]

Enhancing the Butterfly model

  • Put a slider for q
  • Add patches-own variable to indicate whether it was visited.
  • Add turtles-own variable to remember the patch where it started.
  • Increase the number of butterflies to 50.
  • Stop butterfly from moving if it’s at the top of a hill.
    • How can you tell whether it’s on the top?

Enhancing the Butterfly model

  • Write a reporter for corridor width

    \[ \text{Corridor width} = \frac{\text{# patches visited}}{\text{distance from start}} \]

  • Put an observer on the interface
  • Define a reporter:
to-report corridor-width
  let wid ... ; calculate corridor width
  report wid
end

Behaviorspace

Running Experiments: BehaviorSpace

  • Vary any parameter that has a control on the model’s interface
  • Writes output to .csv spreadsheet file (table output is the most useful).

    Behaviorspace experiment

Output from BehaviorSpace Experiments

  • Note: Data written in spreadsheet might be out of order.

    "BehaviorSpace results (NetLogo 5.3.1)"
    "jg_butterfly_1.nlogo"
    "vary-q"
    "01/25/2016 23:08:47:963 -0600"
    "min-pxcor","max-pxcor","min-pycor","max-pycor"
    "0","149","0","149"
    "[run number]","q","[step]","corridor-width"
    "4","0","999","424.71585264477375"
    "3","0","999","407.8948972331853"
    "2","0","999","402.16008464319225"
    "1","0","999","413.09183879201066"
    "5","0","999","380.4175502215263"
    "6","0","999","408.25117143183326"
    "7","0","999","431.37461560574894"
    "8","0","999","408.38259535508286"
    "9","0","999","421.7254402334981"

Analyzing Behaviorspace Output

library(analyzeBehaviorspace)
launch_abs()

Emergence

Emergence

  • A tricky concept.
  • Growing Artificial Societies: “stable macroscopic patterns arising from the local interaction of agents.”
  • Epstein ten years later: “I have always been uncomfortable with the vagueness and occasional mysticism surrounding this word.”
  • Epstein now prefers to talk about “Generative Social Science”