agent-based modeling and simulation (abms) bertan badur [email protected] department of management...

24
Agent-Based Modeling and Simulation (ABMS) Bertan Badur [email protected] Department of Management Information Systems Boğaziçi University

Upload: godwin-wilkins

Post on 13-Dec-2015

215 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Agent-Based Modeling and Simulation (ABMS) Bertan Badur badur@boun.edu.tr Department of Management Information Systems Boğaziçi University

Agent-Based Modeling and Simulation

(ABMS)

Bertan Badur

[email protected]

Department of

Management Information Systems

Boğaziçi University

Page 2: Agent-Based Modeling and Simulation (ABMS) Bertan Badur badur@boun.edu.tr 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

Page 3: Agent-Based Modeling and Simulation (ABMS) Bertan Badur badur@boun.edu.tr Department of Management Information Systems Boğaziçi University

Outline

1. Introduction and Objectives

2. A Model with Less-Emergent Dynamics

3. Simulation Experments and BehaviorSpace

4. A Model with Complex Emergent Dynamics

5. Summary and Conclusions

Page 4: Agent-Based Modeling and Simulation (ABMS) Bertan Badur badur@boun.edu.tr Department of Management Information Systems Boğaziçi University

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

Page 5: Agent-Based Modeling and Simulation (ABMS) Bertan Badur badur@boun.edu.tr Department of Management Information Systems Boğaziçi University

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

Page 6: Agent-Based Modeling and Simulation (ABMS) Bertan Badur badur@boun.edu.tr Department of Management Information Systems Boğaziçi University

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

Page 7: Agent-Based Modeling and Simulation (ABMS) Bertan Badur badur@boun.edu.tr Department of Management Information Systems Boğaziçi University

Learning Objectives

• Less or emergent results form ABMs • Designing and alalysing simulation experiments• BehaviorSpace• Analys outputs by graphical or statistical methods

Page 8: Agent-Based Modeling and Simulation (ABMS) Bertan Badur badur@boun.edu.tr Department of Management Information Systems Boğaziçi University

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

Page 9: Agent-Based Modeling and Simulation (ABMS) Bertan Badur badur@boun.edu.tr Department of Management Information Systems Boğaziçi University

• 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

Page 10: Agent-Based Modeling and Simulation (ABMS) Bertan Badur badur@boun.edu.tr Department of Management Information Systems Boğaziçi University

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

Page 11: Agent-Based Modeling and Simulation (ABMS) Bertan Badur badur@boun.edu.tr Department of Management Information Systems Boğaziçi University

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

Page 12: Agent-Based Modeling and Simulation (ABMS) Bertan Badur badur@boun.edu.tr Department of Management Information Systems Boğaziçi University

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

Page 13: Agent-Based Modeling and Simulation (ABMS) Bertan Badur badur@boun.edu.tr Department of Management Information Systems Boğaziçi University

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

Page 14: Agent-Based Modeling and Simulation (ABMS) Bertan Badur badur@boun.edu.tr Department of Management Information Systems Boğaziçi University

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

Page 15: Agent-Based Modeling and Simulation (ABMS) Bertan Badur badur@boun.edu.tr Department of Management Information Systems Boğaziçi University

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”)

Page 16: Agent-Based Modeling and Simulation (ABMS) Bertan Badur badur@boun.edu.tr Department of Management Information Systems Boğaziçi University

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

Page 17: Agent-Based Modeling and Simulation (ABMS) Bertan Badur badur@boun.edu.tr Department of Management Information Systems Boğaziçi University

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

Page 18: Agent-Based Modeling and Simulation (ABMS) Bertan Badur badur@boun.edu.tr Department of Management Information Systems Boğaziçi University

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

Page 19: Agent-Based Modeling and Simulation (ABMS) Bertan Badur badur@boun.edu.tr Department of Management Information Systems Boğaziçi University

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

Page 20: Agent-Based Modeling and Simulation (ABMS) Bertan Badur badur@boun.edu.tr Department of Management Information Systems Boğaziçi University

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

Page 21: Agent-Based Modeling and Simulation (ABMS) Bertan Badur badur@boun.edu.tr Department of Management Information Systems Boğaziçi University

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

endto to find-flockmates ;; turtle procedure set flockmates other turtles in-radius vision

set flockmates flockmates with-min [distance myself]

end

Page 22: Agent-Based Modeling and Simulation (ABMS) Bertan Badur badur@boun.edu.tr Department of Management Information Systems Boğaziçi University

NetLogo brainteaser

• 1- why not use

set flockmates min-one-of other turtles [distance myself]

• 2- or

set flockmates other turtles with-min [distance myself]

Page 23: Agent-Based Modeling and Simulation (ABMS) Bertan Badur badur@boun.edu.tr Department of Management Information Systems Boğaziçi University

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”

Page 24: Agent-Based Modeling and Simulation (ABMS) Bertan Badur badur@boun.edu.tr Department of Management Information Systems Boğaziçi University

5. Summary and Conclusions