The Beer Distribution Game
The Beer Distribution Game
Computational notebooks, System Dynamics Models, Agent-based Models and a Reinforcement Learning Algorithm
The Beer Game was developed in the 1960s at MIT to illustrate how difficult it is to manage dynamic systems – in this case a supply chain that delivers beer from a brewery to the end consumer.
This repository contains computational notebooks, simulation models and AI training algorithms that explore the game in depth.
Please read the companion blog posts on our website.
Have a go at playing the Beer Game (on your own or – much more fun – in a group) before you read the notebooks:
You can play the online alone or in a group on our beergame website.
Contents
Notebooks
The model libary contains a number of Jupyter notebooks. The key ones are:
- Understanding the Beer Game. This is the best place to get started - play the Beer Game in single player mode and learn about the dynamics governing the game. This version uses a SD DSL implementation of the Beer Game.
- Simulating the Beer Game This notebook introduces a stock and flow model for the Beer Game and discusses an implementation of that model using the SD DSL.
- An Agent-based Approach To Modeling the Beer Game. An agent-based simulation of the Beer Game that can be used to test policies. It is also used as the basis for the reinforcement learning apporach described in the notebook Training AI to play the Beer Game
- Training AI to play the Beer Game – A Reinforcement Learning Approach. This notebook introduces the concept of reinforcement learning and then applies it to training intelligent agents to play the Beer Game.
Models
This repository contains three simulation models of the Beer Game:
- One version of the Beer Game model built in Python using the SD DSL provided by BPTK. This version is used in the Understanding the Beer Game notebook and is discussed in detail in the Simulating the Beer Game notebook. The code for this version can be found in the src/sd_dsl directory.
- One version of the Beer Game model built using Stella Architect and then utilizing the XMILE transpiler that is part of BPTK. The Stella model can be found in the simulation_models directory. This version of the simulation is used in the Understanding the Beer Game (XMILE) notebook.
- One built using the Agent-based modeling framework that is part of BPTK-Py. The ABM version can be found in the src/abm directory. This version is is used in the An Agent-based Approach To Modeling the Beer Game and Training AI to Play The Beer Game notebooks.