1 / 140

MIS 643 Agent-Based Modeling and Simulation 2017/2018 Fall Chapter 3: Exploring and Extedning

MIS 643 Agent-Based Modeling and Simulation 2017/2018 Fall 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.

lhayes
Download Presentation

MIS 643 Agent-Based Modeling and Simulation 2017/2018 Fall Chapter 3: Exploring and Extedning

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. MIS 643 Agent-Based Modeling and Simulation 2017/2018 Fall Chapter 3: Exploring and Extedning Agent-Based Models

  2. Outline Intorduction The Fire Model The Diffusion-Limited Aggregation (DLA) Model The Segregation Model The El Farol Model Conclusion

  3. Introduction • This chapter is based on • IABM-WR: Chapter 3

  4. 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-organize” without any leader organizer • 4 – Different models emphasize different aspects of the world

  5. 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 of fire form tree to tree • interesting things to say about how likely a fire is sepead all over the forest

  6. 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

  7. Rule 3 • flock of bird - no leader bird or organizer abut how to fly • self-organize without a leader

  8. 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

  9. Outline Intorduction The Fire Model The Diffusion-Limited Aggregation (DLA) Model The Segregation Model The El Farol Model Conclusion

  10. 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

  11. 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 percentage

  12. Tipping Point • know where tipping point is and where you are

  13. Description of the Fire Model • percolation: • in 1987, Denish physisists and complex systems theoritst, Per Bak • self-oganizing criticallity

  14. 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 • green: unburn tree • red: burning tree • brown: burned tree • black: empty space

  15. A Simple Fire Model (cont.) • when setup • Left edge 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 patch is a tree

  16. 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 • Interface – world • origin – center • max-pxcor = 125, max-pycor = 25 • wrap off • patch size: 2

  17. 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

  18. Exercises • Different initializations of trees • Inililize always fixed number of trees • Find other ways of initialization of threes and burning trees

  19. iterations • ask the burning trees to set fire to any neighboring (four neithbors) non-burning trees

  20. go to go ask patches with [pcolor = red] [ ask neighbors4 with [pcolor = green] [ set pcolor red ] ] tick end

  21. Stoping Condition • iterations stop when all trees are burned if all? patches [pcolor != red] [stop] • i

  22. 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

  23. Reporter • write a reporter to return trees fireing • and use the reporter properly

  24. Reporter to report fire-trees return patches with [pcolor = red] end • change go from ask patches with [pcolor = red] • to ask fire-trees

  25. Monitoring percentage of burend trees • Add a monitor to the interface to see the percentages of trees bured • Add a monitor • to the reporter: (count patches with [shade-of? pcolor red]) / initial-trees * 100

  26. 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 slite change in input parameter has a large effect on output

  27. First Extension: Probablistic Transitions • Many simplifying assumptions: • fire does not spread deterministically • but many factors: • wind, wood type, how close the branches are • not certain - with a proabability • Change the go procedure so that a burning tree ignates fire to its neighbor with a probability

  28. 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] ] ...

  29. Silder for probability parameter • add a slider for setting the value of probability-of-spread • from 0 to 100

  30. 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

  31. Second Extension: Adding Wind • wind: • increases the chance of fire spread in the direction 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)

  32. 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,

  33. The pseudocode for all red patches ask their unborn neighbor trees - create and set probability to probability-of-spread - determine the direction - adjust the probability according to the dirction - determine whether the neighbor will burn or not if so -- set its color to red

  34. 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

  35. 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

  36. 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

  37. 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

  38. 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

  39. catch on fire • after determining the probability • set color of the tree just burning if random 100 < probability [ set pcolor red]

  40. 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

  41. New Predicates • towards • self/ / myself

  42. self / myself • context: turtle or patch • "self" and "myself" are very different. "self" is simple; it means "me". "myself" means "the turtle or patch who asked me to do what I'm doing right now." • When an agent has been asked to run some code, using myself in that code reports the agent (turtle or patch) that did the asking. • myself is most often used in conjunction with of to read or set variables in the asking agent. • myself can be used within blocks of code not just in the ask command, but also hatch, sprout, of, with, all?, with-min, with-max, min-one-of, max-one-of, min-n-of, max-n-of.

  43. Example - myself ask turtles [ ask patches in-radius 3 [ set pcolor [color] of myself ] ] ;; each turtle makes a colored "splotch" around itself

  44. towards • towards ageent • context turtle or patch • Reports the heading from this agent to the given agent. • If wrapping is allowed by the topology and the wrapped distance (around the edges of the world) is shorter, towards will use the wrapped path. • Note: asking for the heading from an agent to itself, or an agent on the same location, will cause a runtime error.

  45. Example - towards set heading towards turtle 1 ;; same as "face turtle 1"

  46. 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

  47. 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

  48. 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

  49. 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

  50. Extensions • probablistic sparks or locations

More Related