1.35k likes | 1.37k Vues
Learn how to modify and extend agent-based models to generate complex phenomena and patterns in population behavior. Explore models such as the fire model, segregation model, and El Farol model.
E N D
MIS 585 Special Topics in IMS Agent-Based Modeling Chapter 3: Exploring and Extedning Agent-Based Models
Outline Intorduction The Fire Model The Diffusion-Limited Aggregation (DLA) Model The Segregation Model The El Farol Model Conclusion
Introduction • This chapter is based on • IABM-WR: Chapter 3
Introduction • Learn how to modify and extend an ABM • Four characteristics of AB Modeling • 1 – Simple rules can be used to generate complex phenomena • 2 – Randomness in individual behavior can results in consistant patterns of population behavior • 3 – Complex patterns can be “self-oranize” without any leader organizer • 4 – Different models emphasize different aspects of the world
Rule 1 • many models – simple rules • without any complex math • deep understanding of the knowledge domain • E.g.: the fire model • with very simple rules about spreading o fire form tree to tree • interesting things to say about how likely a fire is sepead all over the forest
Rule 2 • seeing an ordered population behavior • individual level need not be ordered • by fixed rules • stochastic rules mey results ordered patterns at the population level
Rule 3 • flock of bird - no leader bird or organizer abut how to fly • self-organize without a leader
Rule 4 • different models different aspects of the world • For each model filter out some aspects and remove others • Segragation model is about • how urban population develop • but nothing to say about • location of retail stores • or parks • or school districts
Outline Intorduction The Fire Model The Diffusion-Limited Aggregation (DLA) Model The Segregation Model The El Farol Model Conclusion
The Fire Model • Description of the Fire Model • First Extension: Probablistic Transitions • Second Extension: Adding Wind • Third Extension: Allow Long Distance Transmission • Summary of the Fire Model • Advenced Modeling Applications
The Fire Model • many complex systems • critical treshold • tipping point • A small change in one parameter results in a large change in outcome • model of a forest fire • spread of a disease • diffusion of innovation • Sensitive to one parameter: percentage of trees • after some p
Tipping Point • know where tipping point is and where you are
Description of the Fire Model • percolation: • in 1987, Denish physisists and complex systems theoritst, Per Bak • self-oganizing criticallity
A Simple Fire Model • (Wilenksly 1997a), NetLogo library in Earch Science section • Fire Simple in: Simple Models > IABM > Chapter 3 > Fire Extension > Fire Simple • Only patches – four kind • greeen: unburn tree • red: burning tree • brown: burned tree • block: empty space
A Simple Fire Model (cont.) • when setup • Left edeg of World – all red – on fire • when running • the fire will ignate neighboring trees – neighbor four • continues • untill run out of trees • Control parameter: density • a probability whether or not a pacth is a tree
Initialization • set up trees: a randomly seleted patch is a tree with a probablity density. • make a column of burning treese at the left edge • keep track of how many trees there are
setup globals [initial-trees] patches-own [] to setup ca ask patches [ if random 100 < density [set pcolor green] if pxcor = min-pxcor [set pcolor red] ] set initial-trees count patches with [pcolor = green] reset-ticks end
Exercises • Different initializations of trees • Inililize always fixed number of trees • Find other ways of initialization of threes and burning trees
iterations • ask the burning trees to set fire to any neighboring (four neithbors) non-burning trees
go to go ask patches with [pcolor = red] [ ask neighbors4 with [pcolor = green] [ set pcolor red ] ] tick end
Stoping Condition • iterations stop when all trees are burned if all? patches [pcolor != red] [stop] • i
final go procedure to go if all? patches [pcolor != red] [stop] ask patches with [pcolor = red] [ ask neighbors4 with [pcolor = green] [ set pcolor red ] set pcolor red - 3.5 ] tick end
Reporter • write a reporter to return trees fireing • and use the reporter propersly
Reporter to report fire-trees return patches with [pcolor = red] end • change go from ask patches with [pcolor = red] • to ask fire-trees
Monitoring percentage of burend trees • Add a moitor to the interface to see the percentages of trees bured • Add a moitor • to the reporter: (count patches with [shade-of? pcolor red]) / initial-trees * 100
Tipping Point • Experiment with density parameters and see how percent of trees burned changes with the density of trees • At 59% there is a tipping point • a silite change in input parameter has a large effect on output
First Extension: Probablistic Transitions • Many simplifying assumptions: • fire does not spread deterministically • but many factors: • wind, wood type, how close the branches are • not certaion - with a proabability • Change the go procedure so that a burning tree ignates fire to its neighbor with a probability
probabilistic spread • old go statement ask patches with [pcolor = red] [ ask neighbors4 with [pcolor = green] [ set pcolor red ] ... • new go statement ask patches with [pcolor = red] [ ask neighbors4 with [pcolor = green] [ if random 100 < probability-of-spread [set pcolor red] ] ...
Experimentation • Experiment with both probability-of-spread and density parameters • setting probability to 100 returns to the original model • for a given density, high values of probability-of-spread is needed to get almost same percentage of spread
Second Extension: Adding Wind • wind: • increases the chance of fire spread in the directio it is blowing • decreases the chnage of fire spread in the direction it is not blowing • no effect on the chance of spread in the perpendicular direction • Implemented by two sliders • speed from the south (negative from north) • speed from the west (negative from east)
Initialization • both form -25 to +25 • they affect probability-of-spread parameter • Implementation: • create a local variable probability initially set to probability-of-spread parameter • creation by let, setting by set,
The pseudocode for all red pathces ask their unborn neighbor threes - create and set probability to probability-of-spread - determine the direction - adjust the probability according to the diection - determine whether the neighbor will burn or not if so -- set its color to red
Implementation • create and set probability to probability-of-spread: let probability probability-of-spread • determine the direction: compute the direction from you (the green tree) to the burning tree (NOTE: “myself” is the burning tree (the red patch) that asked youto execute commands) let direction towards myself
adjust the probability • if the burning tree is north of you • so the south wind impedes the fire spreading to you • so reduce the probability of spread ifdirection = 0 [ set probability probability - south-wind-speed ] burning tree myself you green tree
adjust the probability • if the burning tree is east of you • so the west wind impedes the fire spreading to you • so reduce the probability of spread ifdirection = 90 [ set probability probability - west-wind-speed ] you: green tree burning tree myself
adjust the probability • if the burning tree is south of you • so the south wind aids the fire spreading to you • so increase the probability of spread if (direction = 180 ) [ set probability probability + south-wind-speed ] you: green tree burning tree myself
adjust the probability • ifthe burning tree is west of you • so the west wind aids the fire spreading to you • so increase the probability of spread if direction = 270 [ set probability probability + west-wind-speed ] burning tree you
catch on fire • after determining the probability • set color of the tree just burning if random 100 < probability [ set pcolor red]
Explanation • modify the probability of spread • increase or decrease accordingly • for each neighnbor • first determine • which direction the fire is trying to spead • how wind effect the probability • with the updated probability • the fie will spread to the neighboring tree
New Predicates • towards • ask
Experimentation • set • density at %100 • let the wind blow strong from the south and west • set probability-of-spead fairly low arond %38 • triangular to northeast
Third Extension: Allow Long Distance Transmission • another effet of wind: enables fire to jump over long distances • add a switch to control jumping • in NetLogo – control boolean variables • add – big-jumps: on and off • off: reduced to Fire 2 Model • on: ingnate new fire at some distance in the direction of the wind
the code if random 100 < probability [ set pcolor red ;; if big jumps is on, then sparks can fly farther if big-jumps? [ let target patch-at ( west-wind-speed / 5 ) ( south-wind-speed / 5 ) if target != nobody and [pcolor] of target = green [ ask target [ set pcolor red ];; to ignite the target patch ] ;; end if target ] ;; end big-jump? ] ;; end random 100
if big-jumps? is true • it looks for a target patch some distance away in the direction of the wind • experiment with different parameters • observation: lines in the direction of wind Figure 3.7 • increases the probability of raaching the other end but reusting patterns are different with • chunks of world not burned • as new features are added modify the questions and the measures
Extensions • probablistic sparks or locations
Summary of the Fire Model • three change to the basic model • affecting tipping point in different ways • as model assumptions or mechnizms change new measurse msy be needed • in Extension 3 • whether the file will move to right edge mey not be a good measure • Tipping points: • characteristics of inputs and outputs • not the models’
Advanced Modeling Applications • generalized into model of a percolation: • Given a structure with probablistic transitions between locations • how likely that an new entity diffuses form one side to another • E.g.: • innovation diffusion • spread of diseases – epidemiology
Outline Intorduction The Fire Model The Diffusion-Limited Aggregation (DLA) Model The Segregation Model The El Farol Model Conclusion
The Diffusion-Limit Aggregation (DLA) Model • Description of the Diffusion-Limit Aggregation (DAL) Model • First Extension: Probablistic Sticking • Second Extension: Neighbor Influence • Third Extension: Different Aggregates • Summary of the DAL Model • Advenced Modeling Applications
Intorduction • in ABMs no direct relation between • complexity of resulting pattern and • complexity of the uderlying rules • simple rules may create complex pattrns • focus not on complex rules but on interractions • ABMs are interesting: • not because what each agent does • what tghe agents do together