Herd Immunity
Work in progress! Details below could change!
Introduction
Also known as the Billiard Ball Game, and various alternatives! It's a fun and pretty Java application that shows a load of coloured balls bouncing around a space. At the beginning they will either be green (susceptible), or blue (vaccinated). Then a couple will turn red (infected), and they will each try to infect the next R0 different balls they bounce into. If those victims are susceptible, then they will turn red and start trying to do their own infecting. When R0 attempts to infect have been made, they becoming immune (grey). The vaccination percentage, and R0 are the things you can choose; R0 is a whole number between 3 and 8, and vaccination between 0 and 100% in 10% intervals.
After each run, the number of infections made is recorded and plotted on a graph; there is one graph for each value of R0 with vaccination coverage on the x-axis, and number of hosts on the y-axis. After a few samples have been connected, a best fit curve will be plotted, showing the basic herd immunity principle: vaccinating for example 30% of the population causes a reduction of much more than 30% in the final number of cases.
The game can be used as a standalone application, or with various additional dependencies, it can be controlled through a tablet, which has been our favourite and most engaging way of using the game in public events.
Running on a Standalone Machine
Download the ZIP file here, which containing Java source and compiled classes. I compiled with Java 8u91; install Java from Oracle if you need to. Unzip it to any folder you like. (Don't just run it from inside the ZIP - it won't work!). If you need an unzipper, try 7-Zip. Then click on run_local.bat in the root folder. (Or simply javaw Herd. Being native Java code, it should also be fine on Linux and Mac, but I haven't specifically tested.
The User Interface
It's really easy. You click the up and down arrows vary the reproductive number, and the percentage vaccination, then you click the big button to run the simulation. Then you wait and watch in awe and wonder as the simulation runs and presents you its results. At the end, you'll see a graph of all the collected samples for that R0, and the key will highlight which sample was the one you just did. (Afraid in the current standalone version, you can't name your sample, which you can with the android version below. I might fix that one day - then again, it's nice to not really need a keyboard while you're demoing).
Demo mode
If you run run_local_demo.bat (or javaw Herd /DEMO), then it runs in a demo mode, which cycles round non-interactively, collecting data evenly across vaccination coverage and R0 - so if you leave it running overnight, it will collect enough samples to give you good looking best-fit curves for all the graphs. There's no exit button, so you'll have to do ALT+F4 in windows to exit. (Need to test Mac/Linux!)
Managing Data
There's a batch file clear.bat, which will make a directory of the form bkp_yyyymmdd_hhmmss, and copy the current data in it. Then it will replace the data files with the ones found in "bkp_OneSample", which contain just a single point for every graph. And to restore a previously backed up dataset, (which is just a file copy really), restore.bat bkp_201609012_152819 for example. NB - at present, these batch files have the working directory hard coded into the file. I'll fix this soon - in the meantime, edit them!
Running with Androids
Web Server
We'll be using tablets to talk to the Herd Immunity main app, by being on the same wifi network, and communicating via the Web Platform for MRC Outreach Events - it's the same platform used for the Barcode Epidemic, so you only need to set it up once on one laptop, even if you want to run both the Barcode Epidemic and the Herd Immunity app at the same time. The only thing I'd suggest is: run the Herd Immunity app on a laptop of its own, because it wants all the resources it can get to run smoothly. Anyway, see the Web Platform for MRC Outreach Events page for setting up the web server platform, and make a note of the IP address of the web server, because the Herd Immunity Android app will want to know it.
Usage History
Here are the events where we've used this game.
- March 2015 - HPRU Open Day.
- July 2014 - Imperial Y10 Summer School Workshop - Harriet Mills and Rafal Mostowy.
- June 2013 - MRC Centenary, Science Museum
Credits and Thanks
The Herd Immunity Java code, Android code and Web support was written by Wes Hinsley. The idea, and a lot of later ideas to make it much more exciting, was from Neil Ferguson. Many thanks also to all who demonstrated this in exciting ways at the Centenary event.