Transcript Emergence

Agent-Based Modeling
and Simulation
(ABMS)
Bertan Badur
[email protected]
Department of
Management Information Systems
Boğaziçi University
Emergence
• Chapter 8 of Agent-Based and Individual-Based
Modeling: A Practical Introduction, by S. F.
Railsback and V. Grimm
• BehaviorSpace Guide of NetLogo User Menual
• NetLogo’s Model Library Biology category
– Simple Birth Rate
– Flocking
• models
Outline
1.
2.
3.
4.
5.
Introduction and Objectives
A Model with Less-Emergent Dynamics
Simulation Experments and BehaviorSpace
A Model with Complex Emergent Dynamics
Summary and Conclusions
1. Introduction and Objectives
• important and unique - ABMs
• emergence of
– complex, often unexplained – system level
– from – underlying processes
• unpredictable
• unexplanable in principle buy by simulation
• Properties:
– not sum of properties of individuals
– different result – individual properties
– can not be predicted from individual properties
Corridor width in butterfly
• outcome – corridor width
• not sum of or individual property
– how bfs move: uphill or random
• influenced from – movements and environment
• width – time sum of where individual bfs are
• qualitativly predictable to some extend
– as q decreases – wirdth increases
• So width emerges from
– movement of bfs: uphill or random
– envirnonment
•
Level of emergence
• too low emposed
– no need for an ABM
– modeled with other methods
• too many results emerging complex ways from
complex individual behavior
– too compleicated to be understood
• Best
– intermediate level of emergence
Learning Objectives
•
•
•
•
Less or emergent results form ABMs
Designing and alalysing simulation experiments
BehaviorSpace
Analys outputs by graphical or statistical methods
2. A Model with Less-Emergent Dynamics
• Biology Category of NetLogo’s Library – Simple
Birth Rates
– How birth rate differences of two spefies influence number
of these species
• number of ofspring produced – time step
• probability of death – constant
• Experiments
– red-fertility – at 2.0
– vary blue-fertility from 2.1 to 5.0
• graph of
– ticks until red extingtion v.s. blue-fertality
•
•
•
•
When birth rates are close,
they - co-exitst for a long time
As the difference in birth rates increases
the time to red extinction decreases rapidly
3. Simulation Experments and
BehaviorSpace
• Experiments – replicates of senarios
– stochastic elements
• senarios – “treatment” statisticians
• senario defined
– model, parameters, inputs, initial conditions
• vary blue-fertility from 2.1 to 5.0 in increments of
0.1
– 30 senarios, 10 replicates for each
– each run continues until nomore red turtles
– output: ticks number extinction occured
• mean and standard deviation of time to extrnction
• v.s. blue fertility rate
Sensitivity Experiments
• Vary one parameter over a wide range and
investigate how model resopnses
• How the model and system it represents
– response one factor at a time
• BehaviorSpace - seperate program
– run simulation experiments
– save the results in a file
• Fuctions
–
–
–
–
Create senarios – varying global variables
Generate replicates – (repitations in NetLogo) of senarios
Collect results from each run and write to a file
Run some NetLogo commands at the end of each run
Using BehaviorSşpace
•
•
•
•
From Tools menu open BehaviorSpace
Create a new experiment – new
Name of experiment
Vary variables
– blue-fertility from 2.1 to 5.0 with increments 0.1
[“ blue-fertility” [2.1 0.1 5.0.1 ] ]
• Constants
– [“ red-fertility” 2.0 ]
– [“ carrying-capacity” 1000 ]
• repititions value 10
• “Measure runs...”
– ticks
• stop condition
– red-count
= 0
Programming note: How BehaviorSpace
works
• At the start of each run
– set variables in “Vary variables...” before entering setrup
• When “Measure runs...” is not checked
– written to output after a run stops
• stop in go or
• “stop condition” in BehaviorSpace
• “Time limit” box
• When “Measure runs...” is checked
–
–
–
–
firet output – end of setup
then each time go completes
if a stop in go – no output at thet time
use a “stop condition” or “time limit” – produce ougtputat
the end of go just before stoping
to obtain output at every time step
•
•
•
•
1- remove stoping statements from go
put them to BehaviorSpace
2- put ticks as a first statement tıo go
then stop so
4. A Model with Complex Emergent
Dynamics
• Biology of NetLogo’s Library “Flocking”
• Reynolds (1987)
• How complex and realistic dynamocs can emerge
from simple agent behavior that could not be
predicted
• School of fishs and flocks of birds – emergent
properties of how individual animals move against
each other
• individuals behavior – adjusting their movement
direction in response to direction and location of
other nearby individuals (their “flockmates”)
Objective4 of turtles
• all other turtles within a radius
– vision parameter
• Three objectives:
– moving in the same direction with theri flockmates – align
– moving towards the flockmates – cohere
– maintaining a minimum seperation with others – seperate
• Parameters
– maximum angle a turtle can rotatre
– minimum seperation distance
• Complex results
• Parameters interract
two Properties of Results
•
•
•
•
flockings complex
flocks change characteristics
change parameters – characteristics change
Parameters interract
– the effect of one parameter depends on the value of other
• Show two common characteristics of emergent
dynamics
–
–
–
–
1- qualitative – hard to describe with numbers
state of the birth rate model with two numbers
2- it takes some time before the patterns emerge
worm-up period – dynamics gradually emerges
Level of emergence
• What results output?
• for the birth rate – obvious time until red turtles
went extinct
• Emergence?
– 1 – results different from sum of individual properties
– 2- different type of results
– 3- not easity predicted
• Yes
Quantitative measures
• Number of turtles who have flockmates
• The mean number of flockmates per turtle
• The mean distance between a turtle and the nearest
other turtle
• The standard deviation of heading over all turtles
– a simple meadure of variability in direction
•
•
•
•
get output from every ticks
number of ticks – 500
number of replications – 10
one senario – “baseline” – default parameter
values
Meadure runs using these reporters
count turtles with [any? flockmates]
mean [count flockmates] of turtles
mean [min [distance myself] of other
turtles] of turtles
standard-deviation [headıng] of turtles
• add
set turtlemates no-turtles
crt population
...
end
Another Experiment
• if turtles adapt their direction considering only their closest
neighbor
• change
to find-flockmates ;; turtle procedure
set flockmates other turtles in-radius
vision
end
to
to find-flockmates ;; turtle procedure
set flockmates other turtles in-radius
vision
set flockmates flockmates with-min
[distance myself]
end
NetLogo brainteaser
• 1- why not use
set flockmates min-one-of other
turtles [distance myself]
• 2- or
set flockmates other turtles withmin [distance myself]
Contrasting senarios
• Another common experiment type
• look at differences betwen two or more different
senarios
• replicate and see how outputs are different in
different “treatments”
5. Summary and Conclusions