DEV Community

Cover image for Teaching systems thinking through computer games
Steven Read for Read the Architecture

Posted on • Originally published at jacquiread.com

Teaching systems thinking through computer games

There have been a number of times in my life when I have found that I have learned things through doing, and then later discovered empowering vocabularies and models which further enhance and improved what I was already doing. Domain-driven design was one such area, but systems thinking recently became another.

To illustrate my point we have Theme Park; a game I played in my early school years, which was overflowing in systems experiences. In the game you manage staff, set prices and salaries, build a park, stock shops, and more. Behind every computer programmer you often get a background story about computer games, so I guess I am no different.

Today we will be using Theme Park to introduce a systems thinking modelling technique โ€“ the Stocks and Flows diagram. The purpose? Well besides to apply stock and flow diagrams, it was to explore an explosive phenomenon that can occur when you have a busy system, which I will refer to as the vomit loop๐Ÿคฎ. Some actions within this system are optimisations โ€“ staff training for instance. Others such as staff strikes could place the system in a critical position. Many of those optimisations that enable operation at scale then only make the system more susceptible to failure.

A vomit loop in Theme Park

The diagram is made up of:

๐Ÿ› ๐—ฆ๐˜๐—ผ๐—ฐ๐—ธ๐˜€: Where some entity is accumulated over time via inflows and outflows. This could also be considered like a water level. A bath can be described as a stock of water

๐ŸŒŠ ๐—™๐—น๐—ผ๐˜„๐˜€: Where a stock is being changed over time, typically measured as a rate. Water going down the plug hole is a flow

๐Ÿงฎ ๐—–๐—ผ๐—ป๐˜ƒ๐—ฒ๐—ฟ๐˜๐—ฒ๐—ฟ๐˜€: Calculated values based on other parts of the system, or boundary values entering the model. Despite stocks and flow diagramsnot including converters in the name they are an import part of the notation

โžก๏ธ ๐—”๐—ฟ๐—ฟ๐—ผ๐˜„๐˜€: Representing the effects of each instance on the others

The following relationships are also illegal:

๐Ÿšซ Flows cannot influence other flows

๐Ÿšซ Stocks cannot influence other stocks

๐Ÿšซ Converters cannot influence stocks

In my diagram I have used all of these components, and used the terms ๐˜ณ๐˜ข๐˜ต๐˜ฆ to label ๐—ณ๐—น๐—ผ๐˜„๐˜€ and ๐˜ด๐˜ต๐˜ฐ๐˜ค๐˜ฌ to label ๐˜€๐˜๐—ผ๐—ฐ๐—ธ๐˜€. All remaining components are ๐—ฐ๐—ผ๐—ป๐˜ƒ๐—ฒ๐—ฟ๐˜๐—ฒ๐—ฟ๐˜€. As you can see the model is pretty large already, so for brevity, in an attempt to avoid text becoming too small, I have simplified the modelling of litter and toilet stocks.

The stocks and flows diagram allows us to investigate changes within the system

If all of your cleaning staff go on strike, you are quickly left with no option but to close the park, or suffer significant reputational damage. Are there other solutions? Yes! Multiple cleaning contracts, or having sickbags at the exits to exciting rides and bins around the park. This is where your stocks and flows diagram comes in. You can use the diagram to explore how new measures would affect the system. The diagram isnโ€™t to document a system, it is to explore changes to the system.

Top comments (0)