NetLogo Workshop Series� �Week 1�Session 1 – NetLogo: Getting Started
Jiin Jung, LU Psychology - jiin.jung@lehigh.edu�
Objectives
Toolkits for ABM
NetLogo
The Logo Turtle
Logo
The Logo Turtle
The Logo Turtle
�
Let’s Download NetLogo
Running NetLogo
The main NetLogo window should come up looking like this:
Let’s create a turtle!
Type codes in Command Center
Create
buttons
Write codes
Now, programming the actions of a turtle!
While we are taking a break
Write a NetLogo program that generates two different polygons—a triangle and a hexagon based on user input.
Basic Agents
Turtles
Turtles
Patches
Links
* Graph Layouts
A Brief History of �Agent-Based Modeling
20
21
John von Neumann’s �universal constructor
22
Artificial Life
A creation which can reproduce itself
Artificial Life
23
“soft” Alife
“hard” ALife
Cellular Automata
Robots
What is “Cellular Automata”?
A collection of cells on a grid, each cell is in one of a finite number of states (e.g., on and off), and changes its state following simple rules based on the states of its neighboring cells.
24
A model consists of a large number of simple components (cells), which are modified only by local interactions, but which acting together can produce global complex behavior.
Stephen Wolfram (1984) Cellular automata as models of complexity
1-dimensional cellular automata
25
You may draw on papers or whiteboards manually, or…
26
Model01: Von Neumann’s Cellular Automata Model
28
NetLogo > Model Library > Cellular Automata > CA 1D Elementary
29
You can run forever….
30
Model02: Conway’s Game of Life
John H. Conway’s Game of Life
32
John H. Conway’s Game of Life
33
John H. Conway’s Game of Life
34
Block
Boat
Blinker
Pulsar
Glider
Simple rules generate complex patterns.
35
36
Four Classes of CA Behaviors
Class 1. The pattern disappears with time. All initial conditions lead to exactly the same uniform final state . It is entirely predictable, independent of initial state
37
Stephen Wolfram (1984) Cellular automata as models of complexity
CA Rule 248
CA Rule 254
CA Rule 32
Four Classes of CA Behaviors
Class 2. The pattern evolves to a fixed finite size. There are many different possible final states. But all of them consist just of a certain set of simple structures that either remain the same forever or repeat every few steps. You can predict local behavior from local initial state.
38
Stephen Wolfram (1984) Cellular automata as models of complexity
CA Rule 232
Four Classes of CA Behaviors
Class 3. The pattern grows indefinitely at a fixed speed. Class 3 patterns are often found to be self-similar or scale invariant. When parts are magnified they are indistinguisible from the whole – Fractals. The patterns appear random and chaotic.
39
Stephen Wolfram (1984) Cellular automata as models of complexity
CA Rule 30
Four Classes of�CA Behaviors
Class 4. The pattern grows and contracts irregularly. Changes are irregular. Behaviors are effectively unpredictable. The pattern of class 4 appears between class 2 and class 3.
40
CA Rule 110
Four Classes of CA Behaviors
Class 1 Class 2 Class 3 Class 4
Simple Complex
Predictable Unpredictable
Complex systems��Interdisciplinary��Generative�
42
Science with “Agent-Based Modeling”
Discussion questions
Which sport is more complex, soccer vs. basketball?
Is a system more complex or less complex than the sum of parts? Why so? Examples?
Please write a few research questions agent-based modeling can be used.
43