GEOG3150 Semseter 2 Lecture 4 COMPLEXITY AND EMERGENCE Dr Nick Malleson Dr Alison Heppenstall Re-cap: last week… Social simulation Interest in ‘60s and again in ‘90s (with AI). Agent-based modelling The uses of simulation. Explanatory vs predictive Recap: Why is social simulation important? Understanding more about society through… Testing out ideas using simulation to… Create new knowledge, test existing theories, create new theories and create new insight in… A computer generated environment that… Overcomes (some) ethical problems Modelling Recap: Bottom up v.s. top-down Aggregate Advantages Individual-level Ci = α + βxi + βyi + βzi Simplicity Homogeneous Individuals Very large systems Disadvantages Low-level dynamics (‘smoothing out’) Modelling interactions and emergence Representing complex systems Advantages Heterogeneity Interactions (Human) Behaviour Emergence and complex systems Disadvantages Difficult to create Computationally expensive Difficult to define (choose important variables) Practical recap.. We’ll spend ~5 minutes going over some of the material covered in the practical. How do you do the following: Change the value of a variable? Ask the turtles to change their colour? Ask the blue turtles to move to the point (5,14)? (Then review this diagram). Ask the turtles to do more than one thing (e.g. turn blue and then move forward) Make a procedure called ‘move-turtles’ ? Call the procedure from the ‘go’ procedure? Make a global variable with a slider Lecture 4 These are all key concepts! Emergence Cellular Automata and the Game of Life Non-linear dynamics Complexity Chaos Readings Flake, G. (1998) The Computational Beauty of Nature. MIT Press Wolfram, S. (2002). A New Kind of Science. Wolfram Media Railsback, S.F., 2012. Agent-Based and Individual-Based Modeling: A Practical Introduction. Princeton University Press, New Jersey. (Page 101+) Emergence: What is it? “A property of a collection of simple sub-units that comes about through the interactions of the subunits and is not a property of any single subunit” - Gary Flake “The way that complex systems and patterns arise out of a multiplicity of relatively simple interactions” - Wikipedia “The whole is greater than the sum of its parts.” - Aristotle (?) Attribution: Discott https://en.wikipedia.org/ wiki/User:Discott Attribution: Yewenyi at the English language Wikipedia https://en.wikipedia.org/wiki/User:Yewenyi Emergence questions When watching the video, think about: If there is no leader, how are flocks etc. controlled? List some of the organisms that demonstrate emergent behaviour Can you think of any other examples of emergent phenomena Emergence: What is it? http://www.pbs.org/wgbh/nova/ nature/emergence.html http://www.youtube.com/w atch?v=aEaZHWXmbRw (up to 4:50) Emergence: What is it? Simple rules -> complex outcomes In the past, we have assumed that complex phenomena are driven by a complex mechanism This is not always the case Possible to prove the with simple computer programs Agent-based models are one example, others to follow… Emergence: A new kind of science? “I even have increasing evidence that thinking in terms of simple programs will make it possible to construct a single truly fundamental theory of physical, from which space, time, quantum mechanics and all the other known features of our universe will emerge.” - Wolfram (2002) Game time! http://www.icosystem.com/labsdemos/the-game/ Rules Everyone randomly selects 2 individuals – person A and person B. Now move so that you always keep A in between yourself and B – so that A is your protector from B. At some point Nick will say ‘stop’. Then you become the protector, and need to move so that you keep yourself between A and B. Health and Safety Slippery, uneven ground, please be careful Don’t leave the field This isn’t compulsory, so if you don’t have sensible shoes (or don’t want to come) you can wait here. Lecture 4 Emergence Cellular Automata and the Game of Life Non-linear dynamics Complexity Chaos An Example of Emergence: Cellular Automata Not dissimilar to an agent-based model. Useful here to demonstrate emergence Consist of a grid of cells (similar to NetLogo patches) Rules drive behaviour of cells E.g. If more than two neighbours repaint their house, I will repaint mine. E.g. If farmers around me start to grow barley, I will grow maize All cells driven by the same rules But cells can be in different states An Example of Emergence: Cellular Automata Simple rules can produce complicated patterns. E.g. fractals Cellular Automata in Geography Great for physical geographical systems Land use / land cover change Forest fires Water systems .. etc .. (look up some examples yourselves) NetLogo Demos: Voting (people’s votes are influenced by their neighbours) Fire (spread of forest fires) Percolation (oil spreading through earth) What is are the main differences between a cellular automata and an agent-based model? The Game of Life A cellular automata Beautiful example of simple rules leading to complex outcomes Cells can be alive (black) or dead (white) Rules for each cell: If dead, and alive neighbours = 3 → Alive If alive, and alive neighbours < 2 → Die of loneliness If alive and alive neighbours > 3 → Die of overcrowding Otherwise, stays as it is. The Game of Life in NetLogo ‘Life’ model The Game of Life Gliders A glider is a pattern that travels across the board in the Game of Life Very useful! Can transmit information across the world Building blocks for many other objects (by colliding in a particular way) The Game of Life Glider Gun A pattern that automatically creates gliders Running the model Initial configuration See https://en.wikipedia.org/wiki/Conway%27s_Game_of_Life Image attributed to Kieff (https://en.wikipedia.org/wiki/User:Kieff) The Game of Life Spaceships Lightweight spaceship David Eppstein's weekender Loads of other examples ... For more information, see: http://www.conwaylife.com/wiki/Spaceship The Game of Life So what?! This might all seem fairly pointless … … the really interesting stuff happens when these different patterns are combined ... ... and they start to produce patterns that look like a living thing … The Game of Life Examples Use software called ‘Golly’ http://golly.sourceforge.net/ Examples Breeders Create new patterns Life -> breeders -> p90 rake factory Life -> breeders -> space filler Others Life-like -> Replicator Life-like -> Spiral growth Life-like -> Coral Remember the key message -> these complex, life-like patterns emerge through the application of three simple rules. Emergence: why is it important? Key message: Complex structures can emerge from simple rules Emergence is hard to anticipate Cannot be deduced from solely analysis of individuals’ behaviour Emergence is a characteristic of complex systems Emergence: why is it important? Global (macro) level patterns are the result of micro interactions. Individual-level modelling is focused on understanding how macro-level patterns emerge from micro-level through the process of simulation. Macro: global scale e.g. the largest scale you are modelling at e.g. regional, country Micro: small scale e.g. individuals, households Real Example: Segregation – Schelling Thomas Schelling (Harvard) looked at racial segregation. You will have experimented with his model in the last practical Initially 1D, then 2D, cellular automata / ABM Cells either 1 or 0 (“black” or “white”). If neighbourhood > x% of another colour, move to nearest area where this isn’t true. NetLogo: Demonstration What do you think happens when 35%, 50% and 80% preferences are selected? 35%: 50%: 80%: Schelling Results Even with low individual preferences for neighbour similarity, segregation develops. 35% preference 50% preference 80% preference (Also, if preference is too high, then no one is satisfied) Lecture 4 Emergence Cellular Automata and the Game of Life Non-linear dynamics Complexity Chaos Linear Systems Linear: the output of a system is linearly proportional to the inputs Example: You have a population of 10 bunnies Each bunny will have 4 bunny babies You can work out how many bunnies there will be in 3 generations: Generation 1: 10 bunnies. Generation 2: 10 X 4 = 40 bunnies. Generation 3: 10 X 4 X 4 = 160 bunnies Generation n: 10 X (n-1) bunnies This is an example of LINEAR system. Linear Systems Example of a linear system. With bunnies! Now, we increase the number of bunnies per parent. You have a population of 10 bunnies You have a population of 10 bunnies Each bunny will have 4 bunny babies Each bunny will have 6 bunny babies You can work out how many bunnies there will be in 3 generations: You can work out how many bunnies there will be in 3 generations: Generation 1: 10 bunnies. Generation 2: 10 X 4 = 40 bunnies. Generation 3: 10 X 4 X 4 = 160 bunnies Generation n: 10 X 4(n-1) bunnies Generation 1: 10 bunnies. Generation 2: 10 X 6 = 60 bunnies. Generation 3: 10 X 6 X 6 = 360 bunnies Generation n: 10 X 6(n-1) bunnies If we change the model inputs, there is a linear change in the outputs Non-linear: A bunnies tale The bunny population continues to grow in a linear fashion. All those tasty bunnies don’t go unnoticed by predators As the predator population thrives, the bunnies diminish. However, as the predator’s food is scarce, their population begins to fail. The bunny population recovers. The cycle begins again. Now, if we change the bunny growth rate, what will happen? Non-linearity in wolf-sheep model Demo: wolf-sheep predation Run the model (with grass) Now, I am going to kill some of the sheep, what will happen? Non-linearity in the wolf-sheep model Unlike our bunny population, removing sheep has unexpected effects Changing model inputs has a non-linear impact on the model outcomes We cannot predict how the system will behave (At least not very far into the future) Understanding the interactions between wolves, sheep and grass is the key Non-linearity In general, non-linear systems are any system where the inputs are not linearly proportional to the outputs. E.g.: Thresholds Rule-based Random etc. Non-linearity leads to “chaos” /chaotic dynamics Irregular dynamics where the system keeps changing without exact repetition. More on “chaos” later… Nonlinearity – A Mathematical Example Lotka-Volterra equations Mathematical representation of predator-prey system x is the number of prey y is the number of predators α, β, ζ, δ are parameters The population fluctuates alpha = 2 beta = 0.5 gamma = 0.2 delta = 0.6 Nonlinearity – Another Mathematical Example The logistic map xn1 rxn (1 xn ) Mathematical representation of a population growth model xn -> ratio of existing population to the maximum possible population at year n r -> reproduction or starvation, depending on population size What happens as r increases? Logistic Map What happens as r increases? The program that I demonstrated in the lecture was made by Dan Olner. You can run it yourself here: http://www.personal.leeds.ac.u k/~geodo/exploringchaos/ Attributiong: Gisling (http://commons.wikimedia.org/wiki/User:Gisling) on Wikipedia Lecture 4 Emergence Cellular Automata and the Game of Life Non-linear dynamics Complexity Chaos Flocks – AgentBased Swarms Result of agents working together to produce groups that follow each other E.g. herds of animals, flocks of birds, or schools of fish. http://www.youtube.com/watch?v=qJjeHLcbQJ0 Question How is the flock controlled? Boids Scientists have puzzled over how flocks are controlled A solution has been offered by Craig Reynolds (1986) – a simulation of flocking behaviour Each agent has the following rules… Avoid colliding with your neighbour most of all. Fly in the average direction of your neighbours. Try to move into the centre of the flock (to prevent being eaten). The seemingly realistic flocking patterns suggest that it is an emergent phenomena with no ‘leader’. Flocks – How they act http://www.youtube.com/watch?v=GUkjC-69vaw Uses of flocking agents Simulating how crowds move. Popular Post-Hillsborough. Notting Hill Carnival MausHouse Lecture on this later… Bringing it all together … Complex Systems Systems that exhibit the features we have seen in this lecture can be called ‘complex’. Complex systems are Non-linear Driven by large numbers of variables Have emergence as a key feature Can demonstrate spatial and temporal variance Note: Complex ≠ complicated e.g. the Lotka–Volterra equation But… “The jury is still out as to how the word ‘complexity’ should be defined” (Flake, 1998, p 135) Lecture 4 Emergence Cellular Automata and the Game of Life Non-linear dynamics Complexity Chaos Chaos Chaotic systems Tiny changes can have huge impacts The ‘butterfly effect’ Example: The logistic map (in earlier slides) Edward Lorenz’s 1960s weather simulation Photo attributed to Gianfranco Reppucci on Flickr http://www.flickr.com/photos/giefferre/4446877066/ Behaviour is deterministic But very difficult to predict in the long term Chaos One lecture (or even a whole course) cannot do justice to this new, potentially revolutionary area of scientific research. Do some reading! You’ll find it fascinating (And it will be obvious in the exam who really understands all this… ) Complex Geographical Systems Traditional modelling techniques cannot handle the defining features of complex systems Particularly non-linearity and emergence But most geographical systems are complex systems! Individual-level modelling techniques are showing great potential for modelling geographical systems. Complex Geographical Systems The weather Chaotic system (tiny changes lead to dramatic effects, ‘discovered’ by Edward Lorenz) Ensemble modelling to manage the chaos Nonlinear partial differential equations, similar to a cellular automata (I think!) Crowds Uncountable human-human and human-environment interactions What causes protests to become riots? … more on these practical applications later in the course… Issues – Geographers Can Save the World There are several major questions we’d want to ask of geographical systems if we could. Stability: does the system have a dynamic equilibrium or does it fluctuate? Robustness: can the system withstand shocks and still produce sensible outputs? Sensitivity: will a small perturbation produce chaos? If we can identify complexity within systems, we can: Understand them better Manipulate them to our own requirements Make better predictions Summary Emergence: sum is greater than the parts Bottom-up / individual-level modelling is focused on understanding how macro-level patterns emerge from micro-level through the process of simulation. Non-linearity: Relationship between two variables is not linear (Predator-prey) Complex systems: Exhibit non-linearity and emergence. Very difficult to predict! Chaos: Small changes lead to huge impacts Further reading / watching To really have a chance of understanding these concepts, you’ll need to do some more research. The resources below are a good place to start. Also see the list on the course website: http://www.geog.leeds.ac.uk/courses/level3/geog3150/lectures/lecture4/ Igor Nikolic, Complex Adaptive Systems TED talk http://tedxtalks.ted.com/video/TEDxRotterdam-Igor-Nikolic-Comp Read a relevant chapter in my favourite academic book Flake, G. (1998) The Computational Beauty of Nature. MIT Press Systems of Systems (IBM) http://www.youtube.com/watch?v=h2br2_twHfw Clips from a BBC Documentary about chaos (ideas about chaos are closely related to complex systems) On the VLE (not publicly available) https://vlebb.leeds.ac.uk/bbcswebdav/xid-4312172_2 A full-legth BBC documentary: “The Secret Life of Chaos” Available on Box of Broadcasts: http://bobnational.net/record/21567 Next week How to model interactions and behaviour. Seminar – The Ethics of Individual-Level Modelling Promises something different. Two short readings. http://www.geog.leeds.ac.uk/courses/level3/geo g3150/seminars/seminar2/ A video to finish... http://tedxtalks.ted.com/video/TEDxRotterdam-Igor-Nikolic-Comp