An Introduction to Discrete Event Simulation

An overview of discrete event simulation and its applications.

An overview of discrete event simulation and its applications.

Discrete event simulation is a powerful tool used across industries to analyse and optimise operations and processes. Ever since its founding in the late 1950s, alongside the emergence of computer science, discrete event simulation has come a long way in terms of development and usefulness.

In this introduction to discrete event simulation, we aim to:

  • Provide an overview of discrete event simulation
  • Provide an overview of the software tools available for discrete event simulation
  • Pinpoint what problems discrete event simulation can solve and how it can be useful for your business
  • Explain the steps involved in building a discrete event simulation model
  • Provide example scenarios in which discrete event simulation can be applied, including simple and complex scenarios.

What is Discrete Event Simulation (DES)?

A discrete-event simulation (DES) models the operation of a system as a (discrete) sequence of events in time.

Discrete Event Simulation, Wikipedia

DES can be used to simulate almost any process you can think of whether it be as simple as waiting at the deli to receive an order, or as complicated as advanced manufacturing. Regardless of how complicated a DES model may be, there are three key characteristics that are seen within all simulations:

  1. Event-Based: The simulation progresses by moving from one event to the next in time (rather than discrete even time slices).
  2. Discrete State Changes: The state of the system changes only at these discrete points in time.
  3. Stochastic or Deterministic: Events can occur based on a probability distribution (stochastic) or can be predetermined (deterministic).

The third characteristic, specifically the stochastic trait, is likely the most important as this trait allows us to model real-life operations within realistic parameters and data gathered from past experiments, which can help us gather realistic results and help solve problems.

Each DES model requires the following to properly function:

  1. Simulation Entity – A basic entity that can run through the simulation
  2. Entity Generator – Generates entities to run in the simulation (usually serves as the beginning of a process)
  3. Queue – Stores received entities until they are needed for the next component
  4. Server – Processes a received entity for a specific duration (represents a timed event that requires a specific entity)
  5. Entity Sink – Destroys any entity received (serves as the end of a process).

To show how all of this comes together, a very basic model that contains and links each part together to create a process flow is illustrated below.

DES Model Example

An explanation of the the above example:

  • The simulation begins with the simulation entity “SimEntity1” being generated by the entity generator “EntityGenerator1
  • After being generated, the entity travels to the server’s queue “Queue1” and “Server1” and waits there until all other entities have been processed by the server
  • Once its past the queue, the server processes the entity for a specific time
  • Finally after the server, the entity travels to the entity sink “EntitySink1″ where the entity is then destroyed, thus representing the end of the process for that entity.

Note: All the DES model examples in this article are made using a open source simulation software JaamSim, which will be explained in detail later in this article.

DES Approach to Problem Solving

Discrete event simulation thrives when it comes to running multiple nodes at once, debottlenecking and optimization.

To put this into perspective, lets explore the hypothetical example of designing a new airport. You know that for people to get to their respective gate and flight, there must be several services desks for checking-in bags and other processes, a security process, and several different terminals for passengers to travel to. Other amenities include shops, restaurants, bathrooms, elevators, escalators, and so on. Applying DES here would take all of these “nodes” into account when building the airport and determine what is the best way to optimally utilise each node. So for this example, we would build an example model of the airport with DES under the allocated resources (money, staff, etc.) that are available and run that model within specific parameters to gather passengers’ total time traveling throughout the airport as well as other data. Then, we would view the data and try to determine what node has the greatest impact on the passengers’ overall travel time. Finally, we would return to the model, edit this node or “potential bottleneck” and run the model again to get different results. We would then repeat these steps in a trial-and-error fashion until we find the bottleneck of the airport system and create the most optimised layout of the airport.

Ultimately, DES is utilised to solve efficiency-related business process problems, as DES always proposes the following question: “What are the best changes that can be made in order to truly optimise a process?”  

The specific steps taken for organisations to reach this optimisation and efficiency can be shown by the DES Engagement Process. The engagement process is outlined below.

1. Understanding the Process

When you approach a problem, understanding what you are actually solving and optimising is likely the most important part of the process. This includes not only having well documented background information, but also having tacit knowledge of the problem. There is a lot of value to be held within this “discovery phase”, as this phase can lead to a lot of opportunities for improvement right away if done properly.

Important considerations include:

  • Learning what process you are modelling
  • What events are involved and the order of these events
  • How these events start, how they end, and what they produce
  • Which parts of the model can represent which events (what servers and other process flow parts can represent).

2. Gathering Statistical Distributions

It is important to gather the proper statistics for a problem while keeping note of the objective function. This means that the data you collect represents something that can be improved upon and measured by going through this entire process, whether it be making something cheaper, more efficient, higher throughput, and so on. However, keeping in mind the realistic parameters of the problem is also key, as every system has its tradeoffs. Finally, determining whether the data applies to this problem or not.

Important considerations include:

  • Which distributions and values apply to what events and elements
  • Distributions can be based on observed data, information in a database, or assumptions depending on the desired accuracy.

3. Building the Model

Typical steps in building a DES model include:

  • Creating the flow and its respective distributions in a DES
  • Showing what the process produces as a whole
  • Linking each event to its respective element, distributions, values, and code within the program.

4. History Matching

It’s important to note that if you are not able to history match the model with its realistic counterpart, then its highly likely that you have misunderstood something or an important assumption that you previously made was incorrect. This is why steps 1 and 2 are the most important, because if there’s an incorrect perception of the entire problem, or if the data is wrong, then it can lead to issues within the validity of the model. In summary, if you fail to history match the model, then return to steps 1 or 2 as there is likely a mistake.

Important considerations include:

  • Verifying that the model produces its real-life counterpart
  • Ensuring values and distributions used are realistic and make sense
  • Ensuring the final product represents what is made/desired in reality.

5. Running the Experiment

The final step is running the experiment, considerations include:

  • Utilising scenarios and replications to create accurate and realistically distributed results
  • Changing nodes to see the effects on results
  • Learning how to achieve efficiency through minimalistic, realistic, and cost-efficient changes.

DES Software Tools

There are a various DES software tools available. Some of these tools include but are not limited to the following:

  1. AnyLogic – A large, general-purpose, multi-method modelling tool. Combines agent-based system dynamics, and discrete event modelling.
  2. Rockwell Automation – also known as Arena, now a part of Rockwell, is a large, general-purpose, multi-method simuilation modelling tool.
  3. Simul8 – A commercial simulation software, especially popular in Australia.
  4. Simcad Pro – A simulation software that includes a virtual reality and physics engine, and allows for model changes while the simulation is running.
  5. Enterprise Dynamics – a platform that allows you to create a digital twin with applications in manufacturing, material handling, and logistics.
  6. JaamSim – Open source simulation software that has 2D/3D graphics and a drag-and-drop interface.

It’s important to note that each of these tools have their own uses in terms of the scale of the projects. For example, if a project has a smaller scale and less of a budget, “Simul8” may be an appropriate option due to its lightweight nature, or open source “JaamSim” may be appropriate due to it being free and simple to use. For larger projects with bigger budgets and high complexity/compute requirements, “AnyLogic” and “Rockwell Automation” may be a better fit.

Some of the tools mentioned above have free and “pro” versions. For example, the free version of “JaamSim” provides all the basic tools used to build a model, but “JaamSim Pro” provides faster execution speed, more flexible data interoperability, and access to web models where users can access a model and run it through their own parameters.

Finally, the size of each of these tools is what makes discrete event simulation so interesting. The flexibility that can be seen within these tools shows how there are so many opportunities to utilise DES, and that there is always a lot of value to be held within models despite how big or small they are.

Example DES Models

Below are some examples of hypothetical “real world” applications of discrete event simulation models in two separate industries/use cases.

Example 1: Basic DES Model – Airport Security

In this example let us imagine that the manager of an Airport is looking to improve the efficiency of its security process. A basic model below could look like the below.

Basic Airport Security DES Model

A summary of the above:

  • The entity is presented as a “Flight_Passenger“, and the entity generator represents the passenger arriving at the airport via the entity generator labeled “Airport_Arrival“.
  • The passenger waits in the security queue, “Security_Queue”, until they can enter the server labeled “Security“, which represents the passenger going through security.
  • After making it through security, the passenger then goes to board their flight which is represented by the entity sink labeled “Board_Flight”, marking the end of the process.

Example 2: Basic DES Model – Gold Beneficiation

In this example we have a Gold Mine Manager who is seeking to improve the process of finding and preparing gold for the market. A basic model below could look like the below.

Basic Gold Beneficiation DES Model

A summary of the above:

  • The entity is presented as “Gold_Ore”, and this ore is mined/created via the entity generator labeled “Gold_Mine”.
  • After being mined, the gold ore waits in the queue labeled “Beneficiation_Queue” until it can enter the server labeled “Beneficiation”.
  • After the gold ore goes through the beneficiation process, it is shipped off to the gold market which is represented by the entity sink labeled “Gold_Market”.

Notice how this model relates to a much more common and relatable scenario than the previous. This relates back to that point that DES can be applied to any process, whether these processes involve niche manufacturing or common day-to-day tasks. As for both models, they can each seek efficiency to a certain degree by applying pre-determined values to each part of the model. However, to get realistic data, we will need to create a stochastic model with many more process-flow parts.

Example 3: Basic DES Model – Gold Beneficiation

The basic Gold Beneficiation DES model can be useful to an extent, but its simplicity can serve as a major obstacle towards gathering realistic data. Some unrealistic implications of the model include:

  1. The entire gold beneficiation process is represented as a single server. In reality however, the beneficiation process is composed of several other steps including crushing, grinding, and extracting the ore.
  2. There is no transportation time between each part, even though in reality, the ore takes at least a little bit of time to travel from event to event.
  3. Each event has a set time value that it takes to complete. In reality, nearly no process can repeat itself while taking the same amount of time as the last run-through.
  4. There is always a chance that some of the ore may go to waste, and the model above has no way of identifying which ore is wasteful.

In order to compensate for these issues, we can:

  1. Add more servers and queues
  2. Create entity conveyor belts which transport received entities on a specific path at a certain speed
  3. Add normal distributions to each server that each have their own mean, maximum, minimum, and standard deviation value
  4. Add a discrete distribution connected to a branch event. The branch, indicating the success rate of the ore, chooses whether the ore is wasted or is shipped to the market via the discrete distribution, which has set probabilities to whether the ore is wasted or not.

Putting this all together now, a more complex version of this model may look like the below:

Complex Gold Beneficiation DES Model

A summary of the above:

  • The previous server in the Basic Gold Beneficiation model labelled “Beneficiation” has been divided into three separate servers labelled “Crushing_Process”, “Grinding_Process”, and “Extraction_Process”.
  • Each of these servers are linked to their respective distributions above each of them. Additionally, various entity conveyors including “Ore_Transportation”, “Conveyor_Belt” and “Shipping_to_Market” have been added as well as a new entity sink, branch, and discrete distribution.
  • The “Success_rate” chooses whether the ore is shipped to the market or goes to the “Wasted_Gold” entity sink based on the value chosen by the “Success_Rate_Distribution”.
  • This success rate process that we used represents the yield of gold and how all gold is not usually perfectly recovered when it goes through this process.
  • Additionally, we can add graphical components to our model so we can understand what is happening on a more visual and analytical basis.

Complex Gold Beneficiation DES Graphical Model with Statistics

In the above graphical model, a statistics section containing average queue wait times and counters has been added. Additionally, a graph of the combined average queue wait length is created and bar gauges next to each server indicating their progress completed on their respective entities being worked on.

Upon running the simulation, we can see the following results.

Complex Gold Beneficiation DES Graphical Model with Statistics Running

Now that the model is more realistic and stochastic (despite the demo values of seconds and minutes being used above), the Mine Manager can utilise the data presented above and the data in the downloaded Excel report to go back and tweak one of the nodes in a trial-and-error fashion in order to determine which changes to a node produce the most efficient and optimised outcome.

Even this “complex” example only scratches the surface. A real life DES model for gold processing would be closely linked to the process flow of that specific gold mine taking into consideration the specific processing and equipment used at that site, such as whether it employs carbon in leach (CIL) or carbon in pulp (CIP) processes, the various types/stages of grinding, the type of mill, whether gravity screening is employed, the amount/quality of sensors, reliability of data in the historian, and so on.

In Summary

Discrete Event Simulation is an incredibly useful and flexible technique that can be used in many organisations. Whether you are simply collecting a couple data points from a simple model, building a model with hundreds of nodes, or even setting your own parameters in a pre-built model, DES will provide the flexibility within its tools to allow you to do as you please.

DES modelling can help your organisation to improve decision making, identify bottlenecks, reduces costs and wastage, optimise resources, minimise downtime, predict system performance under various conditions, and conduct risk-free experimentation before costly investment.

Despite its versatility, DES still isn’t a technique that can do everything efficiently. Due to its events being clinical, discrete occurrences rather than places where the variables of the system can change, it’s not great at modelling variable changes within each event or effects on a system as a whole, such as modelling fluids, kinematics, and traffic. Other modelling techniques that can be used for this can include continuous modelling or agent-based modelling.

Hopefully, this article was an informative introduction to DES, its applications, and how it may apply to your organisation. Please do not hesitate to contact the team if you would like to know more about discrete event simulation, or the implementation of other simulation and optimisation techniques.

Acknowledgements

A special thank you goes to our New York based 4CDA intern Nick Vowinkel, who helped put this article together during his internship.