The right tool for the job: applying simulation techniques to real world problems

John Hill
January 27, 2021

Simulation modelling comprises a set of techniques for creating digital representations of real-world systems for the purpose of studying, analysing and predicting performance - as well as identifying real-world interventions to improve system behaviour.

Like its close cousin Artificial Intelligence, simulation modelling is a broad church which encompasses a range of different mathematical and computational techniques which have strengths and weaknesses in application to domain problems.

Simulation modellers can be dogmatic in their preferences for one approach over another. However, I believe that a good simulation modeller has a grasp on the range of different tools in the simulation toolbox, and a clear understanding of the characteristics of domain problems that each is best suited to.

In this post I will cover three of the main general-purpose techniques in the simulation toolbox with examples of where each is a good fit. These are System Dynamics (SD), Discrete Event Simulation (DES) and Agent-based Modelling (ABM).

System Dynamics

System Dynamics is the most abstract of the three simulation methodologies that this article explores. It is concerned with capturing the dynamic nature of the structure of a complex system, rather than the effects introduced by the individual properties of the actors - the people, products or events - within the system. It recognises that the structure of the many circular, interconnected and time-delayed relationships between a system's main components are often just as - if not even more - important in determining behaviours than the individual components themselves. In that way it can be considered a holistic or integrative approach to the modelling and simulation of systems.

There is a particular focus on the dynamic effects of particular structures - for example feedback loops - which give rise to important long-term dynamics. One famous application of System Dynamics to the management of supply chains is the so-called Bull-Whip effect; named by analogy to the way in which the amplitude of a whip increases as it travels down the whip's length: a small flick of the wrist generates large movements (and hence high speeds) at the whip's tail.  Customer demand is rarely stable, and businesses must forecast demand in order to position inventory and other resources necessary to meet future demand. Moving up the supply chain, from customer demand to raw materials production, each supply chain participant has greater observed variation in demand. In other words, the fluctuations are amplified as they pass through the supply chain.

By observing and simulating the supply chain as a whole system - rather than treating each supply chain participant as independent - allows executives and decision makers to get a new perspective on the management of their supply chains and identify mitigating actions - or changes in system structure to ensure optimal performance over long time horizons.

SD emerged from the MIT Sloane School of Management in the 1950s under the influence of Jay Wright Forrester. Forrester had trained as an Engineer and was determined to bring insights from Science and Engineering to bear on the core issues that determine the success of failure of corporations.

Forrester showed that you could study systems by identifying key state variables (Stocks) and their rates of changes (Flows) which are represented mathematically as differential equations. In this sense, Systems Dynamics modelling and Differential Equation Modelling are one and the same - an SD model has a one-to-one mapping to a Differential Equation model, and vice-versa. However, Differential Equation modellers usually hold mathematical (analytical) tractability as their goal. That is, the ability to derive definite results and conclusions from the model’s equations.

SD takes a more practical perspective and instead relies on numerical simulation to obtain results and leverages visual interpretation of charts and diagrams to draw conclusions. SD models are easily consumable by non-experts - and by non-mathematicians - which makes them a powerful aid to communicating and socialising the decisions reached by way of their analysis. The SD framework is particularly amenable to visual User Interfaces which can be used to communicate not only model structure, but also the dynamics and interactions of the system components expressed in clear and easy to interpret time series charts. By leveraging an underlying foundation of differential equations, however, SD models retain the ability to perform a variety of advanced analyses including sensitivity analysis, causal tracing, and optimisation.

A Differential Equation for Population Growth and its SD representation in Silico

Population growth as a function of growth rate and a state variable, Population.

Note the time-series charts produced as the model is simulated forward through time.

SD is applicable to a broad swathe of modelling problems that present themselves in modern data-driven corporates where system performance is a product of the complex interactions of a number of factors, and where decision makers want to gain some degree of foresight into system performance under a number of potential future scenarios.  Live examples range from Sales and Marketing Analytics to Supply Chain Stress Testing and Workforce Analytics.

It represents a significant step-up in analytical sophistication from non-system approaches such as spreadsheet modelling which remain dominant in most large organisations.

Discrete Event Simulation

DES takes a different approach to the simulation of complex systems. Rather than focusing predominantly on system structure, DE modellers codify system behaviour as an ordered sequence of clearly defined events. Events take place at specific (discrete) time steps and mark a change in the state of the system. Between events, the system state remains unchanged, allowing time to progress in jumps from one event to the next. This is called next-event time progression. An alternative time progression is called fixed-time progression. As the name suggests, time is allowed to progress in fixed intervals and the system state is reported at the end of each time slice - even if there is no change to the system state. Computationally, fixed-time progression simulations will tend to run slower since, by definition, the system state will be reported more frequently.

DES is particularly well-suited to studying and optimising well defined processes which proceed as a sequence of clearly-defined steps. They are a powerful method of identifying (and hence removing) bottlenecks to production or throughput across the system as a whole.

A working system simulation can also be used to simulate key metrics and performance drivers, again in order to identify opportunities for system optimisation. Typical metrics for a DES might include things like worker utilization, scrap rate, or on-time delivery rate.

Typical applications for DES are found in manufacturing and logistics, where processes such as factory production lines, maintenance scheduling or fleet optimisation lend themselves well to the simulation as a series of ordered discrete events, and where the ROI on eliminating performance bottlenecks is significant

2 Examples of DES model structures

Agent Based Modelling

ABMs are arguably the most powerful simulation methodology for representing complex systems. But at the cost of increased model complexity and a greater degree of difficulty in validating and verifying simulation outputs.

An ABM simulates the actions and interactions of (usually) large numbers of autonomous agents with a view to generating system-level behaviour from the bottom up.  ABMs allow for high level system behaviours to emerge from the interactions of lower-level entities and sub-systems. ABMs are often used to show how seemingly simple rules at the level of the individual agent can - through their interactions with other agents' behaviours - generate rich and complex behaviour at the level of the system as a whole. Simple behaviours that agents may be capable of include learning, adaptation, and reproduction.  When allowed to proceed through time, these behaviours generate an enormous potential space for system behaviour to evolve into.

ABM as a discipline grew out of Enrico Fermi's work on subatomic particle interactions in the 1930's. Perhaps the most significant contribution since Fermi was made by John Conway whose Game of Life retains a cult following, among those who see in its patterns evidence of something fundamental to all life, to this day. Conway's Game works like this:

  1. Create a grid of squares.
  2. Assign to each grid a state (alive or dead) and fill the cell accordingly.
  3. The Game proceeds through time by applying four simple update rules to the cells:
  4. Any living cell with fewer than two live neighbors (8 adjacent cells) dies, as if dying of isolation.
  5. Any living cell with two or three live neighbors continues to live.
  6. Any living cell with more than three live neighbors dies, as if dying of overpopulation.
  7. Any dead cell with exactly three live neighbours becomes a living cell, as if those cells reproduce.

Each time step can be thought of as a single generation where each individual lives, reproduces, or dies. These simple rules are capable of generating complex behaviour at the level of the population (the entire grid) seemingly far in advance of the rules themselves.

An ABM extends the principles of the Game of Life. The agents are stateful, which means they retain information about themselves. Conway's 'agents' - the cells - contain one simple piece of information alive or dead. In an ABM, agents could hold information about their age, height, bank balance, or any other trait deemed useful to the dynamics of that agent's behaviour. The agents in an ABM are also able to communicate with one another. In Conway's Game of Life, communication is restricted to the neighbouring 8 cells. But in an ABM, inter-agent communication can occur geospatially, or across complex communication networks.

Agents are able to perform a range of behaviours: exchanging information across networks, modifying their own state (e.g. by aging) or modifying other agents' states (e.g. by transferring them money). In some models, they are able to reproduce, or die. And in other models they may be able to learn (by getting better at estimating a functional relationship between variables) or adapt their behaviours (by observing what has worked in the past).

This makes ABM a very powerful simulation paradigm, capable of capturing much of the fine-grained information and complexity observed in the real-world. As alluded to earlier, this power comes at the expense of the models being harder to build, but also to verify and validate. Large ABMs can also be computationally expensive.

As a rule of thumb, ABM's are the best option when complex systems are governed by emergent properties which are not adequately captured and explained by lower-fidelity paradigms.

Selecting the best tool

Ultimately, the choice of which tool is the right one depends on the answers to two key questions:

  1. What are the key characteristics of the system under study?
  2. Which of its behaviours are you seeking to understand or modify?

By answering these two questions, we are able to get a strong steer as to which is the right paradigm to bring to bear on our system.

If our system is highly complex, composed of a large number of interacting entities, and we are seeking to explain emergent properties at the system level, then we would naturally turn to ABM. Perhaps we are market traders seeking to explain the performance of an algorithm during a flash crash or other events driven by herd behaviour.

If our system is easily described as a sequence of logical steps which proceed in an orderly fashion, then we would like turn to DES. So if we were seeking to identify which process on an assembly line is holding up the line as a whole, or how an alternative parcel routing strategy might affect delivery times, then DES would likely be able to give us valuable insights.

And finally if we are trying to manage a system where a number of processes interact with one another, or trying to make strategic decisions about how best to allocate resources across a relatively small (e.g. <50) number of different processes, then we would turn our focus on the structure and time-varying nature of the interactions between them using SD.