System Dynamics (SD) & Agent-Based Modelling & Simulation (ABMS)Introduction to ‘whole’ System modellingDavid Buxton, DSE Consulting LTDdave@dseconsulting.co.uk
StructureModelling Vs SimulationSimulation of a systemSystems DynamicsBreakAgent-Based Modelling & SimulationSo how to choose?
1. Modelling Vs SimulationA model is a simplified representation of a system. So why would we want to model?Something to think aboutReduces complexityAllows focusEasier to explainSomething to talk aboutA simulation is derived from a model. It allows us to understand how a model performs under various inputsDue to complexity, models can’t necessarily tell us what is going to happenIf we want something to experiment with = SIMULATIONLearning, Understanding, Comparison, Prediction, Teaching / DemonstrationSpecialist softwareWITNESS (DES)ANYLOGIC (DSE , SD, ABMS)
Doing more than process simulation…Basic structure applicable to 100s of situationsBanks, Retail, Ports, Trains, Passengers, Logistics operations, BBut… How do people interact with the system?
What are consumption trends and how will these affect demand?
What will the competitors response be?
How will connected systems be affected?2. Simulation of a systemOperations systemProcess centric Configurations of resourcesQueuing theoryProcess timings, queue capacities, entity routes through the systemSocial SystemsEntities that have a relationship to each other that create enduring patterns of behaviourEconomic SystemsProduct, distribution and consumption of good and services at the macro level within societyDESABMSSD
Simulation of a systemA systems approach means to need to focus on more that the eventsBoth SD / ABMS try to explain route causeWhat are the factors that are causing these events?Counter-intuitive behaviour characteristicsSystem Dynamics (SD)Part of Systems Thinking (http://en.wikipedia.org/wiki/Systems_thinking)Agent-Based Modelling and Simulation (ABMS)Part of Complex Adaptive Systems (http://en.wikipedia.org/wiki/Complex_adaptive_system)
3. System Dynamics
IntroductionDeveloped by Jay Forrester, continued by John Sterman (Sloan School of Business, MIT)More than just a simulation techniqueIntrinsic part of system thinking“Sales are poor (effect)…because sales staff are not highly motivated (cause & effect)…because salaries are low (cause)”
Base diffusion in AnyLogic
ApplicationsPopulation growth, Biochemical cycles, Economic process, Land-use / ecological systems, Business dynamics and competitionExamples:Bass Diffusion (http://en.wikipedia.org/wiki/Bass_diffusion_model) Beer Game Illustration of the Forrester effect (http://www.systemdynamics.org/products.htm)“Club of Rome & Limits to Growth”
SD notationCausal Loop Diagrams for modellingUse short descriptions to describe the key parts of the systemUse arrows to show how they are connectedUse ‘+’ or ‘–’ notation to show the direction of the relationshipStock and Flow for simulationStocks can be information as well as physical thingsAggregatesFlows are rate changesof stocks defined through differential equationsThey are continuousThey are not random
Causal Loop Diagrams
Feedback and causal loop diagramsEXAMPLE: THE BIOSPHERE+Earth’s temperatureR1Sunshine-+B1Evaporation++B2-B = balancing (an odd number of –ve causal linksR2R = Reinforcing (an even number of –ve causal linksWater on land+Clouds++Rain
Practical 1: causal loop diagramsDraw a causal loop diagram to help explain population changes within a countryWork in groups of 520 mins2 groups will present a summary of their models A ‘A to Z’ of CLDsThink of the elements need in the causal loop diagramThese are variables that can go up or downAdd the causal links, ensuring you include the direction of causationCausal link do not imply a time based sequenceAs the model is constructed think about possible unexpected side effect. Decide if these should be addedHighlight if your feedback are Balancing or ReinforcingTry to keep it simple!++B1R1PopulationDeath rateBirth rate+-
Identifying Feedback structureFeedback structured can be linked to system performanceOnce we have identified the pattern we can look for the structure that is known to cause this behaviourThis can then be used to permanently eliminate the pattern causing behaviourPOSITIVE BALANCING BEHAVIOURREINFORCING BEHAVIOURNEGATIVE BALANCING BEHAVIOURCOMBINATION (WITH DELAYS)
Reinforcing behaviourAlso known as –SnowballingBandwagon effectGrowth starts slowly as it accelerates, it may be too late to stop or slow down the original causal link
Positive balancing behaviourGoal seeking behaviourThe loop structure self corrects to create stabilityFor management processes, can demonstrate resistance to change
Feedback with delayFeedback systems with delays often lead to oscillation and over-shootProduction cyclesEconomic cyclesi.e. Airplane production rates
CombinedIn reality, a variety of curve shapes are possibleBut these models have contributed significantly within marketingMarket penetration of a new product
So where should we start with these?Feedback with delayReinforcing behaviour
Stock & Flow diagramsTo turn a SD model into a simulation, you need a Stock & Flow diagramAs with the CLD, the stock and flow method shows the relationship between variables, but also includes the rate at which they changeThe rate implies a rate of change over timeTime can be 1 day, 1 week, 1 year, etc, but must be consistence throughout the simulationPotential Customers-CUSTOMERSPOTENTIAL CUSTOMERS+B1SalesSales rateCustomers+
Stock & Flow diagramsStocks (the box) can both materials and informationParts, raw materials, personnel, capital equipment, orders, money, hours (between servicing)They accumulate over timeThey are changed by flowsFlows (the valve) are differential equations that connect the stocksThe movement of something from one stock to anotherCan be complicated equations that include a number of internal and external influences
Practical 2: Experimenting with an SD modelOpen the AnyLogic example ‘Bass Diffusion’15 minutesWork in groups of 2 / 3Can you work backwards to draw the appropriate CLD?What are the inputs and outputs of the model?What happens if you change a parameters?Can you identify the elements of variability, interconnectedness and complexity?Drill internal the properties of the stocks and the flows, can you interpret the relationships?
Practical 3: Build your own SDUsing AnyLogic, start using the drag and drop tools to build a stock and flow version of the CLD you developed in practical 1Work in the same groups of 2 / 3Don’t worry about building the equationsFocus on correctly identifying stocks and the appropriate flows and visually linking themYou may need my help to do this!
Problems with SDEffort tends to be spent creating an accurate Causal Loop Diagram, But…there’s always another cause“Sales are poor (effect)…because sales staff are not highly motivated (cause & effect)…because salaries are low (cause and effect)…because profit margins are low…because staff efficiency is poor…because”Models are only valid until something unexpected happensModellers sometimes focus on matching current behaviour structure rather than understanding the systemParameter estimates get less attentionWhy?...Its very difficult to formulate the parameter valuesData availability, particularly due to the aggregation requiredThis leads to a tendency to ‘fit’ the inputs that mimics actual behaviour
Phew…let’s take a breakBack in 10 mins
4. ABMS
ABMS: Philosophy within SimulationTop-down, Reductionist approaches (SD and DES)Scientific explanation of a systemWe can know and model everythingModellers are the system expertsABMS is a bottom up approach and this gives it an unique advantageReductionists cannot explain ‘emergence’ in complex systemsEmergence = “features not previously observed in systems”In DES, emergence is often explained through randomness ABMS is a mindset more than a technologyDescribing systems from the perspective of constituent unitsModelling is completed Agent by Agent and Interaction by InteractionABMS are decentralised and that means there is no place where global system behaviour can be defined
My top 10 reasons for ABMSYour markets are fragmented and there are multiple groups or segments within a population that may behave differentlyThe past is no prediction of the future, but surprises can often be explained with the power of hindsightYour problem is complex and it is difficult to predict how the system will evolveAny element of strategic behaviour or co-operation existsLearning or behaviour is importantYour population has a natural representation of an agent and system performance is significantly related to this agentEstimations of inputs are missing, unavailable or not sufficiently realisticStructural elements are the result, rather than an input to, your modelThere is a geo-spatial element to your modelYou are uncomfortable with the huge assumptions required by Discrete Event Simulation (DES), System Dynamics (SD) or spreadsheet based models* With thanks to Charles Macal whose thoughts during 2010’s OR Simulation conference inspired this list.
ABMSEmergenceFrom Macro to MicroSimple rules of individuals lead to complex systemsAble to understand why, how and where system properties emerge from the causal micro structureCompare this to modelling in DES…So what is an agent?planes, households, organisations, nations, companies, assets
Practical 4: Compare ABMS & SDOpen the bass-diffusion agent based example in AnyLogic10 minsWork in groups of 2Use and experiment with the model. How does it differ from the SD example?Do you think it is easier to communicate and explain the SD model or the ABMS model. Why?Word of mouth can now be modelled accurately, i.e. within a social network. Could this be done in SD?What other Characteristics or Behaviours could the customer agent have?
Comparing ABMS & SD
Agent CharacteristicsAgents live in a dynamic environmentAutonomyProactive and Reactive decision makingLearning and capable of modifying behaviourInteractive and communicativeDecision rules are simple!
Human variability in ABMS: A key challengeBDI reasoning models (http://en.wikipedia.org/wiki/Belief-Desire-Intention_software_model)Belief, Desire, Intention‘bounded’ practical human reasoningBelief…the person’s mental model of the worldDesire…the result they wish to achieve, their motivations & goalsIntention…future plans being made on the basis of those to which the person is already committedThe BDI evaluation process triggers an event by the agentEssentially a decision or plan of actionHard to implement – agents have a tendency to consider their options for too long
How do agents make decisions?Rule based using Decision Tree notationProbabilisticSometimes unavoidable, but not recommended…
How to build an ABMSIdentify your agentWho are the decision makers? Define agent structureImplement these in the simulation using states diagrams, state-transitions and decision treesPut all agents in the environmentEstablishing communicationsRun the modelValidate the modelAs the system tends to show emergent properties, macro (system) validation can be difficult. Focus on mico validation of agents instead!However, its the hardest of all the simulation techniques as it required basic knowledge of Object Orientated programming, and in particular Java
But what about the system? Forget it…
Defining Agent Structure
Agent Example: a Shopper agent
Simulation example: Shopper Modelling
Implementing an agent designStatechartsCompany DeptDrug userAnd State-transitions
Practical 5: Design a consumer agenthttp://www.seesaw.com/ need more customers! They have approached us and want to test a variety of different marketing / media placement strategiesThey need to understand how people will interact with media and what this will lead to for paid subscriptions20 minsWorking in groups of 2 / 3Using ABMS design notation, design a simple consumer agent to help understand the problemStart with the state-chartThen think through the transitions, ie, what will cause your agent to move from one state to the nextConsider how person types may interact with social situations (inc social networks) differentlyMake a list of any other agents you may wish to include in this modelDepending on time – 3 groups will present their designs to the group
5. So how to choose?

System Dynamics (Sd) & Agent Based Modelling

  • 1.
    System Dynamics (SD)& Agent-Based Modelling & Simulation (ABMS)Introduction to ‘whole’ System modellingDavid Buxton, DSE Consulting LTDdave@dseconsulting.co.uk
  • 2.
    StructureModelling Vs SimulationSimulationof a systemSystems DynamicsBreakAgent-Based Modelling & SimulationSo how to choose?
  • 3.
    1. Modelling VsSimulationA model is a simplified representation of a system. So why would we want to model?Something to think aboutReduces complexityAllows focusEasier to explainSomething to talk aboutA simulation is derived from a model. It allows us to understand how a model performs under various inputsDue to complexity, models can’t necessarily tell us what is going to happenIf we want something to experiment with = SIMULATIONLearning, Understanding, Comparison, Prediction, Teaching / DemonstrationSpecialist softwareWITNESS (DES)ANYLOGIC (DSE , SD, ABMS)
  • 4.
    Doing more thanprocess simulation…Basic structure applicable to 100s of situationsBanks, Retail, Ports, Trains, Passengers, Logistics operations, BBut… How do people interact with the system?
  • 5.
    What are consumptiontrends and how will these affect demand?
  • 6.
    What will thecompetitors response be?
  • 7.
    How will connectedsystems be affected?2. Simulation of a systemOperations systemProcess centric Configurations of resourcesQueuing theoryProcess timings, queue capacities, entity routes through the systemSocial SystemsEntities that have a relationship to each other that create enduring patterns of behaviourEconomic SystemsProduct, distribution and consumption of good and services at the macro level within societyDESABMSSD
  • 8.
    Simulation of asystemA systems approach means to need to focus on more that the eventsBoth SD / ABMS try to explain route causeWhat are the factors that are causing these events?Counter-intuitive behaviour characteristicsSystem Dynamics (SD)Part of Systems Thinking (http://en.wikipedia.org/wiki/Systems_thinking)Agent-Based Modelling and Simulation (ABMS)Part of Complex Adaptive Systems (http://en.wikipedia.org/wiki/Complex_adaptive_system)
  • 9.
  • 10.
    IntroductionDeveloped by JayForrester, continued by John Sterman (Sloan School of Business, MIT)More than just a simulation techniqueIntrinsic part of system thinking“Sales are poor (effect)…because sales staff are not highly motivated (cause & effect)…because salaries are low (cause)”
  • 11.
  • 12.
    ApplicationsPopulation growth, Biochemicalcycles, Economic process, Land-use / ecological systems, Business dynamics and competitionExamples:Bass Diffusion (http://en.wikipedia.org/wiki/Bass_diffusion_model) Beer Game Illustration of the Forrester effect (http://www.systemdynamics.org/products.htm)“Club of Rome & Limits to Growth”
  • 13.
    SD notationCausal LoopDiagrams for modellingUse short descriptions to describe the key parts of the systemUse arrows to show how they are connectedUse ‘+’ or ‘–’ notation to show the direction of the relationshipStock and Flow for simulationStocks can be information as well as physical thingsAggregatesFlows are rate changesof stocks defined through differential equationsThey are continuousThey are not random
  • 14.
  • 15.
    Feedback and causalloop diagramsEXAMPLE: THE BIOSPHERE+Earth’s temperatureR1Sunshine-+B1Evaporation++B2-B = balancing (an odd number of –ve causal linksR2R = Reinforcing (an even number of –ve causal linksWater on land+Clouds++Rain
  • 16.
    Practical 1: causalloop diagramsDraw a causal loop diagram to help explain population changes within a countryWork in groups of 520 mins2 groups will present a summary of their models A ‘A to Z’ of CLDsThink of the elements need in the causal loop diagramThese are variables that can go up or downAdd the causal links, ensuring you include the direction of causationCausal link do not imply a time based sequenceAs the model is constructed think about possible unexpected side effect. Decide if these should be addedHighlight if your feedback are Balancing or ReinforcingTry to keep it simple!++B1R1PopulationDeath rateBirth rate+-
  • 17.
    Identifying Feedback structureFeedbackstructured can be linked to system performanceOnce we have identified the pattern we can look for the structure that is known to cause this behaviourThis can then be used to permanently eliminate the pattern causing behaviourPOSITIVE BALANCING BEHAVIOURREINFORCING BEHAVIOURNEGATIVE BALANCING BEHAVIOURCOMBINATION (WITH DELAYS)
  • 18.
    Reinforcing behaviourAlso knownas –SnowballingBandwagon effectGrowth starts slowly as it accelerates, it may be too late to stop or slow down the original causal link
  • 19.
    Positive balancing behaviourGoalseeking behaviourThe loop structure self corrects to create stabilityFor management processes, can demonstrate resistance to change
  • 20.
    Feedback with delayFeedbacksystems with delays often lead to oscillation and over-shootProduction cyclesEconomic cyclesi.e. Airplane production rates
  • 21.
    CombinedIn reality, avariety of curve shapes are possibleBut these models have contributed significantly within marketingMarket penetration of a new product
  • 22.
    So where shouldwe start with these?Feedback with delayReinforcing behaviour
  • 23.
    Stock & FlowdiagramsTo turn a SD model into a simulation, you need a Stock & Flow diagramAs with the CLD, the stock and flow method shows the relationship between variables, but also includes the rate at which they changeThe rate implies a rate of change over timeTime can be 1 day, 1 week, 1 year, etc, but must be consistence throughout the simulationPotential Customers-CUSTOMERSPOTENTIAL CUSTOMERS+B1SalesSales rateCustomers+
  • 24.
    Stock & FlowdiagramsStocks (the box) can both materials and informationParts, raw materials, personnel, capital equipment, orders, money, hours (between servicing)They accumulate over timeThey are changed by flowsFlows (the valve) are differential equations that connect the stocksThe movement of something from one stock to anotherCan be complicated equations that include a number of internal and external influences
  • 25.
    Practical 2: Experimentingwith an SD modelOpen the AnyLogic example ‘Bass Diffusion’15 minutesWork in groups of 2 / 3Can you work backwards to draw the appropriate CLD?What are the inputs and outputs of the model?What happens if you change a parameters?Can you identify the elements of variability, interconnectedness and complexity?Drill internal the properties of the stocks and the flows, can you interpret the relationships?
  • 26.
    Practical 3: Buildyour own SDUsing AnyLogic, start using the drag and drop tools to build a stock and flow version of the CLD you developed in practical 1Work in the same groups of 2 / 3Don’t worry about building the equationsFocus on correctly identifying stocks and the appropriate flows and visually linking themYou may need my help to do this!
  • 27.
    Problems with SDEfforttends to be spent creating an accurate Causal Loop Diagram, But…there’s always another cause“Sales are poor (effect)…because sales staff are not highly motivated (cause & effect)…because salaries are low (cause and effect)…because profit margins are low…because staff efficiency is poor…because”Models are only valid until something unexpected happensModellers sometimes focus on matching current behaviour structure rather than understanding the systemParameter estimates get less attentionWhy?...Its very difficult to formulate the parameter valuesData availability, particularly due to the aggregation requiredThis leads to a tendency to ‘fit’ the inputs that mimics actual behaviour
  • 28.
    Phew…let’s take abreakBack in 10 mins
  • 29.
  • 30.
    ABMS: Philosophy withinSimulationTop-down, Reductionist approaches (SD and DES)Scientific explanation of a systemWe can know and model everythingModellers are the system expertsABMS is a bottom up approach and this gives it an unique advantageReductionists cannot explain ‘emergence’ in complex systemsEmergence = “features not previously observed in systems”In DES, emergence is often explained through randomness ABMS is a mindset more than a technologyDescribing systems from the perspective of constituent unitsModelling is completed Agent by Agent and Interaction by InteractionABMS are decentralised and that means there is no place where global system behaviour can be defined
  • 31.
    My top 10reasons for ABMSYour markets are fragmented and there are multiple groups or segments within a population that may behave differentlyThe past is no prediction of the future, but surprises can often be explained with the power of hindsightYour problem is complex and it is difficult to predict how the system will evolveAny element of strategic behaviour or co-operation existsLearning or behaviour is importantYour population has a natural representation of an agent and system performance is significantly related to this agentEstimations of inputs are missing, unavailable or not sufficiently realisticStructural elements are the result, rather than an input to, your modelThere is a geo-spatial element to your modelYou are uncomfortable with the huge assumptions required by Discrete Event Simulation (DES), System Dynamics (SD) or spreadsheet based models* With thanks to Charles Macal whose thoughts during 2010’s OR Simulation conference inspired this list.
  • 32.
    ABMSEmergenceFrom Macro toMicroSimple rules of individuals lead to complex systemsAble to understand why, how and where system properties emerge from the causal micro structureCompare this to modelling in DES…So what is an agent?planes, households, organisations, nations, companies, assets
  • 33.
    Practical 4: CompareABMS & SDOpen the bass-diffusion agent based example in AnyLogic10 minsWork in groups of 2Use and experiment with the model. How does it differ from the SD example?Do you think it is easier to communicate and explain the SD model or the ABMS model. Why?Word of mouth can now be modelled accurately, i.e. within a social network. Could this be done in SD?What other Characteristics or Behaviours could the customer agent have?
  • 34.
  • 35.
    Agent CharacteristicsAgents livein a dynamic environmentAutonomyProactive and Reactive decision makingLearning and capable of modifying behaviourInteractive and communicativeDecision rules are simple!
  • 36.
    Human variability inABMS: A key challengeBDI reasoning models (http://en.wikipedia.org/wiki/Belief-Desire-Intention_software_model)Belief, Desire, Intention‘bounded’ practical human reasoningBelief…the person’s mental model of the worldDesire…the result they wish to achieve, their motivations & goalsIntention…future plans being made on the basis of those to which the person is already committedThe BDI evaluation process triggers an event by the agentEssentially a decision or plan of actionHard to implement – agents have a tendency to consider their options for too long
  • 37.
    How do agentsmake decisions?Rule based using Decision Tree notationProbabilisticSometimes unavoidable, but not recommended…
  • 38.
    How to buildan ABMSIdentify your agentWho are the decision makers? Define agent structureImplement these in the simulation using states diagrams, state-transitions and decision treesPut all agents in the environmentEstablishing communicationsRun the modelValidate the modelAs the system tends to show emergent properties, macro (system) validation can be difficult. Focus on mico validation of agents instead!However, its the hardest of all the simulation techniques as it required basic knowledge of Object Orientated programming, and in particular Java
  • 39.
    But what aboutthe system? Forget it…
  • 40.
  • 41.
    Agent Example: aShopper agent
  • 42.
  • 43.
    Implementing an agentdesignStatechartsCompany DeptDrug userAnd State-transitions
  • 44.
    Practical 5: Designa consumer agenthttp://www.seesaw.com/ need more customers! They have approached us and want to test a variety of different marketing / media placement strategiesThey need to understand how people will interact with media and what this will lead to for paid subscriptions20 minsWorking in groups of 2 / 3Using ABMS design notation, design a simple consumer agent to help understand the problemStart with the state-chartThen think through the transitions, ie, what will cause your agent to move from one state to the nextConsider how person types may interact with social situations (inc social networks) differentlyMake a list of any other agents you may wish to include in this modelDepending on time – 3 groups will present their designs to the group
  • 45.
    5. So howto choose?
  • 46.
    Correct reasonWhat’s thesystem under study?Most frequently used reasonTechnical background of the modellerTechnical background of the people to whom the model is communicatedWhere could ABMS bring added value?Aircraft repair base exampleFinal thoughts: Mixed Method ModellingIt’s the strength of AnyLogic!Use the tool most appropriate for the problem, or part of the problem)
  • 47.
    Thank you, Questions?FurtherreadingSDhttp://www.public.asu.edu/~kirkwood/sysdyn/SDIntro/SDIntro.htmBusiness Dynamics: System Thinking and modelling for a complex world. John Sterman, 2000ABMShttp://www.dseconsulting.co.uk/index.php/simulation-consultancy/agent-based-modelling-and-simulationManaging Business Complexity. North & Macal, 2010Journal of Simulation, Vol 4, Issue 3 (September 2010)http://www.palgrave-journals.com/jos/journal/v4/n3/index.html

Editor's Notes

  • #14 Introduce the idea of the tipping point
  • #19 Use the aircraft production as the classical example of this one.
  • #40 Use tesco model here
  • #45 Tesco Model