Post on 30-Nov-2014
description
Introduction to Computing for Complex Systems
(Lab Session 1)
Daniel Martin KatzMichigan State University
College of Law
Implementation: From Concept to Product
Implementation
It is important to understand the canonical scholarship as highlighted in the lecture
However, model implementation and the mechanics of other forms of analysis is often the barrier to entry for most scholars
Implementation is the link between concept and scientific product
Different Software Packages
Netlogo = Introductory Modeling Environment (Agent Based Models & System Dynamics)
R = Platform for Statistical Analysis (Includes the IGraph Library for Networks)
Vensim / Nova = Development of System Dynamics and Ecological Models
Pajek = Basic Software for Empirical Analysis & Visualization of Networks
Python = Object Oriented Programming Language Flexible and Fast but High Bar to Entry
Getting Started In
Getting Started In Netlogo
Netlogo is an Introductory Modeling Environment
Developed By Uri Wilensky @ Northwestern in 1999
Maintained by Center for Connected Learning & Computer-Based Modeling @ Northwestern
Getting Started In Netlogo
Syntax is Inherited from the old “Logo” Language
Resnick (1991)
Wilensky (1999)
Papert & Minsky (1967)
Getting Started In Netlogo
Features Aspects of Programming But is Not a General Language ( C++, Python, Java)
Arguably Easier To Learn Than A General Language
Serves the Implementation Needs of Many Modelers
Getting Started In Netlogo
Agent Based Models, System Dynamics Models, Network Models, GIS, Etc.
Download @ ccl.northwestern.edu/
Should Also Acquire User Manual & Dictionary
Version 4.1, Version 4.1 3D, Version 3.1.5
Getting Started In Netlogo
HIV / AIDS VOTING
Where To Get Help
Where To Get Help
Netlogo Front Page
Getting Started in Netlogo
Getting Started in Netlogo
Files Have a Extension of .nlogo
Interface
Information
Procedures
Interface
Information
Procedures
Edit theInformation
Interface
Information
Procedures
Code for the
Schelling’sSegregation
Model
The Models Library
Explore the Available Models
Getting Started in Netlogo
Getting Started in Netlogo
Getting Started in Netlogo
Getting Started in Netlogo
Controls
executes specific commands “on the fly”
Buttons
Command Center
“once” buttons execute one Action
“forever” buttons repeat the same action (Until Stopped)
Settings
Sliders
Switchers
Select a value from a list
Adjust a quantity by increments
Choosers
Set a Boolean variable (true/false)
Monitors
Plots
Offers the Current Value of Variables
Displays the Time Series Plot for a Given Variable or Variables
Views
The Netlogo Language
Four Types of Agents
Patches
Turtles
Links
The Observer
Patches
Tile System with (0,0) Center Origin
pxcormin-‐pxcormax-‐pxcorworld-‐heightworld-‐width
View the Settings
View the Settings
View the Settings
View the Settings
View the Settings
What is a Torus?
Why is It 33 x 33?
View the Settings
Patches: Key Things
Patches do not move -- they are fixed
Patches can breed turtles
Patches can have assigned variables
Patches belong to an agent set
Consulting the Netlogo Dictionary
Descriptions of Patch Primitives Can Be Accessed
Through theNetlogo
Dictionary
Turtles
Turtles move on top of the patches
Have decimal coordinates (xcor, ycor)
Have an orientation (heading)
Can have different shapes
Turtles
Classic Hawk & Dove Model from Evolutionary Game Theory
Runs in Netlogo Version 3.1.5
Inspect Turtles
Right Click on a Turtle (Ctrl + Click on Mac)
Watch a Specific Turtle
Right Click on a Turtle (Ctrl + Click on Mac)
Lots of Different Turtle Shapes
Turtles: Key Things
Turtles move around the environment
Turtles can have various shapes
Turtles can have different variables
Turtles belong to an agent set
Colors
color = agentspcolor = patches
Select a Major Color by Name
Customize Colors Using ## from Chart
Exploring the Forest Fire Model
http://ccl.northwestern.edu/netlogo/models/Fire
The Forest Fire Model
The Forest Fire Model
The Forest Fire Model
The Forest Fire Model
The Forest Fire Model
The Forest Fire Model
The Forest Fire Model
The Forest Fire Model
The Forest Fire Model
The Forest Fire Model
The Forest Fire Model
The Forest Fire Model
The Forest Fire Model
The Forest Fire Model
The Forest Fire Model
The Forest Fire Model
http://ccl.northwestern.edu/netlogo/models/Fire
The Forest Fire Model
http://ccl.northwestern.edu/netlogo/models/Fire
The Forest Fire Model
http://ccl.northwestern.edu/netlogo/models/Fire
The Forest Fire Model
http://ccl.northwestern.edu/netlogo/models/Fire
The Forest Fire Model
http://ccl.northwestern.edu/netlogo/models/Fire
The Forest Fire Model
http://ccl.northwestern.edu/netlogo/models/Fire
http://ccl.northwestern.edu/netlogo/models/Fire
The Forest Fire Model
Tally the Average of five model runs
For Values
50, 55, 60, 65
The Forest Fire Model
Average2.6
The Forest Fire Model
Average2.6
Average5.8
The Forest Fire Model
Average2.6
Average5.8
Average66.5
The Forest Fire Model
Average2.6
Average5.8
Average66.5
Average93.9
Average5.8
Average66.5
Parallel Processing on Percolation Threshold
Lets Do Some additional in Class Data Collection
On Our Fire Model
56
57
58
59
Now LetsDiscuss
The Results
Explore the Code
The Forest Fire Model
;; is for CommentsNot Active
code
What is a Global?
Look it up in the dictionary
What is a Global?
What is a breed?
again, look it up in the dictionary
What is a breed?
The Forest Fire Model
The Forest Fire Model