Barcode Epidemic: Difference between revisions

From MRC Centre for Outbreak Analysis and Modelling
Jump to navigation Jump to search
 
(48 intermediate revisions by the same user not shown)
Line 1: Line 1:
Work in Progress!
[[File:infected.jpg|400px|right]]
[[File:livenet.png|400px|right]]
[[File:epigraph.png|400px|right]]


= Playing the Game =
= Introduction =


== Getting Started ==
The Barcode Epidemic is a game we've used many times, either to help us have conversations about epidemics with the people, or to have a bit of epidemic-based fun at an evening party. Its first outing was in [[June 2013 - MRC Centenary, Science Museum]], although it is based on very successful previous events that basically did the same thing, but without using tablets and barcodes. It works well in groups of around 30+ people in a room, and also works well with a crowd passing through with a few minutes to spend with us. Usually we'd have 2 or 3 people with tablets playing the role of medics, or epidemic containment agents, perhaps in hazard suits. A person becomes infected by having a barcode (QR-code actually) give to them, and they are told to come to the medics with the red tablets to get the remedy. The barcodes get scanned, and the infector is sometimes given some kind of pleasant remedy for their infection. They also may be given a number of barcodes to give out, which represent them spreading their infection to others. Various epidemic statistics are displayed in real time as the epidemic progresses, and various conversations about epidemics might happen on the way.


Usually, everything will have already been set up. So to get everything working, the sequence of events will normally be along these lines:-
The game depends on a bit of technology; setup from scratch can take a bit of time, but once it's all done, it's just a few things to plug in. Particularly: it needs a wireless network (perhaps a private router, or an onsite wifi if you can depend on IP addresses not changing), a laptop running a web server and the software to display all the stats, and a number of tablets to do the scanning.


* Plug in the router and switch it on.
= New Installation =
* Plug in the laptop (server) and switch it on.
* Plug in projector/tv screen, and connect laptop to it.
** '''Test that in advance of any public event.'''
** Not all TVs are friendly. Check the notes about the laptop you're planning to use - whether it has a DisplayPort (HP), HDMI port (Lenovo and others), or a VGA port (almost everything). Check carefully you have the right cable as they are similar! And verify that what you're plugging the cable into supports it and works...
* Check that laptop is joined to mrc_outbreaks network.
* Double click on Live Epidemic on the laptop
* Turn some tablets on. Check they join mrc_outbreaks network.
* Start scanning barcodes.


== How The Game Works ==
If something has gone wrong, or the Barcode Epidemic needs setting up on new equipment, then the following should be everything you need to know. I'll use the current equipment to describe the process; steps will differ with different equipment obviously, but the principles should still work!


* The game works in social events of maybe 30+ people, in a well bounded arena, with a big screen.
== Platforms ==
* Start it by giving one or two people in the crowd a barcode. (Seed infections).
* Tell them to go to "infection control" - the people with the tablets.
* The victim sees the infection controller and presents the barcode.
* We have run two variations of this game; one of the following will apply:-
** The infection controller asks whether the victim is a member of the department, or a visitor. Later on, we look at the graphs to see whether infections spread differently within the two groups, or between them.
** Alternatively, at the Centenary event, we allowed a vaccination probability, giving the victim immunity, and causing them to make no further contacts. The immunity would either be pre-defined (in which case the victim would know already), or their status could be determined by pointing the tablet mysteriously at them and pushing a button.
* The infection controller scans their barcode, then destroys it.
* The tablet tells the infection controller how many infections they should make.
* The infection controller scans a barcode for each of those new infections, and gives it to the victim.
* The victim is told to spread these infections to whoever they want. Tell each new victim to visit "infection control".
* The victim is told they are now immune to further infections. However, it's most fun to keep this fact secret.
* If the victim is given any more barcodes, they must accept them, but they shouldn't visit infection control again.
* Graphs and movies of the current epidemic will be shown in bright colours somewhere in the room.


== The Parameters ==
We've tested the web server and main display on Windows and Mac, and got it all working. No reason I can see why it shouldn't work on Linux as well, but we haven't tested that. I've only tested the barcode printing code on Windows; it's all Java, but as it talks to printers, there's more possibility that something might not work. (That's quite a crude bit of software as you'll see...)
* The tablets communicate with a web server; the dynamics of the epidemic can therefore be changed on-the-fly, without the infection controllers knowing about it.
* If appropriate for the game being played, the vaccination probability can be set.
* The number of contacts is assumed to be poisson distributed around a specified mean.
* However, in practise, we want to truncate the tail quite tightly, so there is a ceiling parameter.
* And in some cases, we wanted to ensure people made at least one contact, so there is a floor parameter too.
* These can be set by browsing to http://192.168.2.2/epi when connected to the mrc_outbreaks network.


= Installation from Scratch =
== The Web Server ==
 
We need to run a lightweight HTTP server that supports PHP, and we'll use it to run a tiny website that supports the communication and data collection. The same platform supports the Herd Immunity app, so I'll put the setup for the common web-related parts on a separate page: [[Web Platform for MRC Outreach Events]]. This includes setting up the server software and hardware.
 
== The Live Display App ==
 
This is a small Java Application which can display a slideshow of graphs of the live epidemic data, interspaced perhaps with movies or images that might be interesting and attractive. One of the graphs is a network graph connecting people's contacts together, which relies on R.
 
=== Install Prerequesties ===
* Java from [http://java.sun.com Oracle].
* R from [http://r-project.org R].
* Inside R, we need the '''statnet''' package, so install that in the R interface.
 
=== Install and Configure the App ===
 
* Download the app - either [https://mrcdata.dide.ic.ac.uk/resources/bc_3.01_full.zip With Media] or [https://mrcdata.dide.ic.ac.uk/resources/bc_3.01_minimal.zip Without] - v 3.01, 26/01/2017.
* Extract it anywhere you like.
* The big zip contains sample movies and images in the '''media''' folder. You can delete what you don't want, but leave '''pause.png''' in there!
* If you want to translate the text on the graphs into new languages, look in the '''lang.txt''' file for instructions.
* To configure the app and the slideshow, look in '''script.txt''', which has instructions inline, but briefly:
** Edit ''Language:'''''EN''' if you want a different language. The one you choose must have matching references in the '''lang.txt''' file.
** Edit ''TimeZone:'''''GMT''' to match where you are, so that the graphs match the time the tablet thinks it is. GMT, or GMT+1, or any standard code is fine.
** Edit ''WebFolder:'' to point to the folder where epi.csv and params.txt are found, where the Epi Webpage is served from.
** Edit ''RScript:'' to point to where Rscript.exe is. (On Windows this is a full path, but Linux/Mac I think is just '''Rscript''')
** ''RNetGraph:'' must point to the R script that creates the network graph - shouldn't need changing, unless you want to make different sorts of network graph...
** Lastly, between the ''Script:'' and ''Loop'' lines, is the set of things that the live app will display. See the instructions in the file, but briefly:
*** ''Movie["path/tomovie1.mp4","path/tomovie2.mp4"]'' - will play a one of these movies to completion on each cycle. The following cycle, it will play the next one...
*** ''Image["path/toimage1.jpg","path/toimage2.png"]'' - similar, but it will display a static image.
*** ''Wait 10'' - will wait 10 seconds. Important, as without it, it will jump to the next part instantly.
* Lastly, to run the app, you need to type '''java BarcodeEpidemic''' while you're in the folder you extracted everything to. Or click on the '''run.bat''' or '''run.sh''' scripts if you're in a GUI.
* The app is full screen - to close it: Windows, press ALT+F4 together. Mac: move the mouse to the top of the screen, and a menu bar should appear.
 
== The tablet ==
 
* Talk to Wes or IT, to find the mystery unlock shape.
* To set it up, you'll need to install two apps.
* Connect it to a WiFi with internet access. If you're using the HP Slate 7, and you want to connect to the Imperial-WPA (or other Enterprise) network, then follow the special instructions on the [[HP Slate 7 2801]] page.
* Use Google Play Store to install an app called '''Pic2Shop'''
* While you're there, you might as well do an update.
* Then install the Live Epidemic App by using Chrome, view this page, and download the app [https://mrcdata.dide.ic.ac.uk/resources/EpiScanner.apk Here]. Then click the various confirmations that you want to open it and install it.
* If the EpiScanner app is already installed, then run it, click on the menu (the three dots in the top right), and check for updates.
* Test by turning on the router, and starting up the web server laptop. Join the mrc_outbreaks network on the tablet.
* And in Chrome, browse to http://192.168.2.2 or whatever the server's IP address is. (See the instructions about the [[Web Platform for MRC Outreach Events]]). You should get our MRC page - if not, check you're really connected to mrc_outbreaks on the tablet, then verify the router and web server are running ok, and the IP addresses match.
* Run the Epi Scanner app, and from the menu (three dots), choose "Set Server URL". You'll want something like http://192.168.2.2/epi.
* Try scanning a barcode.
 
== Making The Stickers ==
[[File:barcodeprinter.jpg|280px|right]]
A very crude Java app for making the stickers is available [https://mrcdata.dide.ic.ac.uk/resources/BarCodePrinter1.0.zip Here]. Unzip it somewhere, and use '''run.bat''' or '''run.sh''' to run it. You'll get a screen full of parameters, and a go button. The labels we used for the first round were made by Niceday, 21 labels per sheet, 63.5mm x 38.1 mm, in boxes of 100 sheets. We found that the printers were not quite as precise as we wanted at printing exactly on the labels, so the parameters here are an example best fit.
 
* First Bar-Code No is the serial number of the first barcode you want to print.
* And Last Bar-Code No is obviously the last barcode you wan to print.
* The Label Spacing (x and y) are distances from the left/top edge of one label, to the left/top edge of the next, in mm, multiplied by 10.
** Horizontally, I made this 66.0mm - (not 63.5mm - there's a 2.5mm gap between labels), so the value is 660.
** Vertically, I made it 38.5mm - the labels touch in the portrait direction.
* Total labels width and height: basically assume labels are printable, non-labels are not, and measure the printable dimensions.
** Horizontally, I made this 195.5mm (1955), which is 3*63.5 + 2*2.5
** Vertically, I made this 267mm - 38.1mm * 7 plus a bit - the 38.1mm must be slightly underestimated.
* The Bar code offsets are the positions of the top-left corner of the barcode, relative to the label. 19.2mm and 6.6mm respectively (192, 66) worked for me.
* And the text offset is the distance from the top-left of the label, to the bottom-left of the text, for the ID number to be plotted. I had to guess this a bit, but 42mm and 35mm were about right.
* Font size is the size of the ID number. 48 is quite nice.
* The labels per sheet is obviously, the number of labels per sheet.
* The URL preamble is the bit before the ID number that will get made into the QR code. The epidemic needs the full URL to end with something like '''?id=1234''', but before that it doesn't care. You can therefore make the barcode point to any site you like that doesn't make me adding that tag on the end.
* And the background image is the backdrop for the label. Mine was a 635x381 pixel image, with a border cut out - Thinking at 100dpi.
* Next, choose the printer.
* And lastly, set the number of millimetres (not mm*10 for some reason), for the position of the top-left of the first label, relative to the page.
* And there's a print button to set things going.
* Your settings will be saved in a text file called qrmake.ini.


If something has gone wrong, or the Barcode Epidemic needs setting up on new equipment, then the following should be everything you need to know. I'll use the current equipment to describe the process; steps will differ with different equipment obviously, but the principles should still work!
= Setting up for an event =


== The Web Server ==
So, assuming all the hardware and software is installed, here's how to run the event.


We need to run a lightweight HTTP server that supports PHP. I like [http://www.aprelium.com Abyss X1]:- it's simple, very lightweight, and there are versions for all platforms. By all means, setup another web server if you prefer, but this one has served very well. Instructions below are for both Windows and Mac; if you use Linux, you'll probably figure out the very simple requirements. My instructions here are very simple - change locations to how you like if you're happy doing that.
== Get the hardware ready ==


=== Installing Web Server Software ===
Assuming everything is ready and updated, so we don't need any internet access at this point.  
[[File:abyss1.jpg|300px|right]]
[[File:abyss2.jpg|300px|right]]
[[File:abyss3.jpg|300px|right]]
==== Download Abyss ====
Download from [http://aprelium.com/abyssws/download.php here] for your platform; Windows, Mac or Linux.
* On '''Windows:''', I installed to C:\Abyss, for simplicity. I tell it to install as a Windows service, and have it start up automatically.
* On '''Mac:''', - I mounted the installer, dragged the ''Abyss Web Server'' folder into my Applications folder, then tried to run the '''Abyss Web Server''' app from new folder I'd just dragged. It complained at me because it didn't come from the App Store, so I had to use '''Control+Click''' to run the app, and confirm I knew what I was doing. Also on running the Web Server, it asked me to confirm I wanted it to ''Activate ports below 1024'' - to which I said Yes, to make it run like a normal web server.
==== Download PHP ====
Aprelium provide convenient downloads for Windows and Mac [http://aprelium.com/downloads/ here]. PHP 5 is fine.
* On '''Windows:''', - I installed into C:\Abyss\PHP5.
* On '''Mac:''', Again, I mounted the installer, and dragged the ''PHP5'' folder into Applications.
==== First-time Setup ====
* Open any browser and go to ''127.0.0.1:9999''. You should get the Abyss First-time Configuration page. Choose your Language (I'll be describing English!). Then choose a user and password, which is specific to managing Abyss. Make a note of it, although you won't need it much.
* On '''Mac:''', At this point for me, Safari got its knickers in a twist and I had to manually restart it. If it brings up a login screen, carry on, but if it seems to not do anything, then restart Safari and browse to ''127.0.0.1:9999'' again.
* Your browser should now be asking you for the user/password you just chose. If you get it right, you'll get to the Web Server config page, and see a bunch of icons.
==== Configure for PHP ====
* In the middle, you'll see "Default Host Running on Port 80." Click ''Configure'' next to it, and then ''Scripting Parameters''. Ensure ''Enable Scripts Execution'' is ticked, and ''Type'' is set to standard. Then under Interpreters, click ''Add'', set Interface to ''FastCGI (Local - Pipes)'', and for Interpreter, you need to locate a file "php-cgi" - where you installed PHP. For '''Windows''', something like ''C:\Abyss\PHP5\php-cgi.exe'', for '''Mac''': ''/Applications/PHP5/bin/php-cgi''.
* Then in ''Associated Extension'', click Add, and add the extension ''php''. Click Ok, and Ok again.
* You should be back at the icons page. Go to '''Index Files''', and add '''index.php'''. Ok, and ok again.
* And press the '''Restart''' button it is offering you. Wait a few seconds, and the config page will reappear. But you're all done now, so you can close it once it's done.


=== Setting up the Epi Website ===
* Router on first.  
[[File:epiweb.jpg|300px|right]]
* Then turn on laptop, and join laptop to the private wifi.  
* First, clear out the default website Abyss came with. If you everything as I did above, then on '''Windows''' it'll be in ''C:\Abyss\htdocs''; on '''Mac:''' ''/Applications/Abyss Web Server/htdocs''.  
* If you're in Imperial, or somewhere the laptop has familiar wifi, it might be a good idea to forget those in case it decides to connect to them on a whim.  
* So delete the files in that folder, and download the Epi Website [https://mrcdata.dide.ic.ac.uk/resources/barcode_epi_web_1.0.zip here]. Extract that zip file into the relevant folder; you should see a file ''index.php'' and a folder ''epi'' within the ''htdocs' folder.
* Turn tablets on, and connect them to the private wifi - again, you might want them to forget any other network they might be tempted towards.  
* In that folder, edit the file '''epi/config.php''' - there is a two line section for Windows, and a two-line section for MAC. Simply delete, or comment (put // at the start of the line) the pair that you don't want. If you've chosen different folders, change the web_folder variable to point to the ''htdocs/epi'' folder we made.
* Connect the laptop to the projector or display before running the live app - we don't want it changing resolutions mid flow.  
* Also, if you did install into different folders, then edit ''clear.bat'' or ''clear.sh'' on Windows or Mac respectively, and change the folder at the top.
* And '''regarding TVs''',  
* '''Mac:''' - I'm a bit unsure of default permissions. It seems Ok in testing, but I don't understand why it's ok. So this may be unnecessary, but to be sure: in a Terminal window:
** Make sure you've got the right cable, and test beforehand. For example, the TV in Pearl Liang, where we often have the short course social epidemic, doesn't support HDMI, even though it has the right ports, so use a VGA cable.
** cd /Applications/Abyss\ Web\ Server/htdocs/epi  (push tab to auto-complete the path...)
** Also remember that if you use the beast (HP Elitebook 8760w, it has an HP DisplayPort, not a HDMI port.
** chmod 755 clear.sh


== Router and Wireless Connectivity ==
== Setting the parameters ==
[[File:dl0.jpg|100px|right]]
[[File:params.jpg|380px|right]]
The Belkin has gone, the D-Link has come. The router is a D-Link DIR-868L, which works fine. Mostly, you'll just have to plug it in, and push the button on the back, and wait for the '''mrc_outbreaks''' wifi network to appear. The D-Link is already configured, so I won't describe that here; but all you need if you set this up on another router, is a wifi network, and to ensure that your web server always gets the same IP. I configured the D-Link so that tablets would get the set IP addresses too, although that shouldn't really matter.
* Browse to the Epi Platform page on whatever IP the laptop has got itself. (See earlier).
* On the "Settings Params" page, here's what the parameters do.
** The reproductive number. The number of new contacts each infector will make, is '''poisson distributed'''.
*** First parameter is the '''mean'''
*** Next is the '''ceiling''' and
*** finally, the '''floor'''.
** The vaccination part. If you want conversations about vaccination to be part of the game, then:
*** '''Vaccination Probability''' is the probability of a person being vaccinated, if you ask the computer. (Which you can - see below)
*** '''Vaccination Efficacy''' is the probability that someome who has been vaccinated gets some benefit from it.
*** '''Vaccination Contact-Multipler''' is the effect of vaccination on the number of infections made, if a person is vaccinated, and it works for them.
** Finally, the app settings.
*** '''Vacc button''' - both the Herd Immunity Tablet app, and the Barcode Scanning app can display a '''Vaccination''' button, and when you tap it, it changes to ''Yes'' or ''No''  depending on the vaccination probability defined above. If you want that button visible in the app, then say YES. Otherwise, if either you don't want to talk about vaccination, or if you have some other way of defining whether people have been vaccinated, set it to NO, and the button will disappear from the tablets.
*** '''Population Division''' or game-type. This option allows you to say, there are two types of people in the world, and when someone is infected, we ask them which kind they are. The effect of this is an extra pair of Scan/Type buttons appear on the android app, so you have one pair for each group of people. Also, some of the text labels on the analysis will change. The different game-types are:
**** '''Departmental''' - in which we distinguish between members of department, and visitors.
**** '''Gender''' - in which we distinguish between male and femals victims.
**** '''Vaccination''' - in which we distinguish between those who were vaccinated, and those who were not.
**** '''None''' - in which case all people are the same, you only get the one pair of buttons in the android app, and the analysis colours are less interesting.
* So change all of these as you want, and then don't forget to click the '''Set''' button to save the changes.


=== To add a server or tablet to the router's DHCP ===
== Reset Previous Data ==
[[File:dll.jpg|200px|right]]
[[File:reset.jpg|380px|right]]
[[File:dl2.jpg|200px|right]]
At some point, you'll need to clear the epidemic and start fresh.  
[[File:dl3.jpg|200px|right]]
* Browse to the Epi Platform page again, and choose the "Reset" page.
* Connect to the '''mrc_outbreaks''' wifi, or attach to the router with a network cable.
* The top entry is to do with the Herd Immunity game, so ignore that.
* Browse to 192.168.2.1, and login with '''admin''', and the secret password which you get by contacting Wes, or IT.
* If you click the CLEAR button next to Live Epidemic, it will take a backup of whatever epidemic is currently running, and reset everything back to empty.  
* Click on '''NETWORK SETTINGS''' on the left, and scroll down to ''ADD DHCP RESERVATION''.
* It might take a minute for all the changes to show up on the live display.
* Feed it a name, the IP address, and the MAC Address of the new machine. Don't know the MAC address?
** On '''Windows''', open a Command Prompt, and '''ipconfig /all |more'''. It will list all your network connections - look for ''Physical Address'' for the right one.
** On '''Mac''', open a Terminal Window, and '''ifconfig''' - look for the right network connection, and the MAC address starts with ''ether''.
** On '''Android''', Something like Apps, Settings, and under System, About Device, and Status. Look for Wi-Fi MAC address.
* Tick the enable box, and click the Add/Update button.


== The tablet ==
== Run the Epidemic ==


* Test by taking a tablet.  
* Start the analysis app! (Run script, or java BarcodeEpidemic).
* Join the mrc_outbreaks.
* Seed the infection by giving someone in the crowd a barcode, and tell them to go to the medic with the tablet to get their cure.
* Browse to 192.168.2.2 to test it.
* The conversation with a new victim then goes along these lines.
* You need two extra apps. Pic2shop does the barcode scanning for us, and there's the Live Epidemic app itself.
** Hello. You seem to have been infected with a disease. Bad luck.
* To install these apps, I'm going to assume you've installed the Android tools, and the hack for the HP tablets described here.
** For '''Gender''',  '''Department''', or '''Vaccination''' games, observe, or discover the victim's gender, departmental, or vaccination status, so you can push the appropriate Scan button on the tablet.
* Connect a single tablet at a time to the laptop. In a command window, change directory to where you put your Android Development Tools (eg, cd \Program Files\Android).
** For the '''Vaccination''' game, it depends how you want the game to run, but you might push the '''Vaccinated?''' button, wave the tablet mystically at the victim, then reveal to them whether they are vaccinated or not. And then tap the appropriate Scan button.
* Then cd sdk/platform-tools. Might be a good idea to copy any apk files you want to install into that folder.
** (For the '''None''' game, there's only one Scan button).
* adb install app.apk (where app.apk is the path to the package you want to install - pic2shop.apk or liveepi.apk)
** So, somehow, you push the right scan button, and point the rear camera at the victim's barcode. Then keep their ticket to one side.
* The apps will install.
** The tablet will ask you to scan zero or more barcodes, one by one. Tap scan, scan the code. Tap scan, scan the code, etc.
* You might need to tell the Live Epi app where the web server is. Click the "three dots" icon in the top left corner, and set the website to http://192.168.2.2/epi/
** For the '''Vaccination''' game, the tablet at this point may have said, "You were vaccinated, but..." - in which case you can talk about vaccination efficacy, coverage, etc.
* Then scan a barcode. If it appears to work, then it probably does!
** Give the new barcodes to the victim, tell them to go and spread the infection.
** And some messages for the victim:
*** They can look out for their number (which the scanner app shows, but is also printed on the barcode they gave you, which you kept to one side), and track their progress on the big screen.
*** Tell them they are now immune, but to keep that a secret. If someone tries to infect them again, take the barcode, but you don't have to see the medic.
*** Go and infect whoever you like, and tell them to come to the medics with the red tablet.
** Remember to press the '''Send''' button at the end.
* '''If you have problems scanning''' - the Type button lets you type in the number printed in a rather small typeface on the ticket. A torch/light can be a good idea.


== The Live Display App ==
= Close-down =


* Finally, we need to install the graph plotter software for the big screen. Firstly, unzip the content into a folder called "C:\Cent". (The name is a legacy from the MRC Centenary events by the way).
* Close the live app with ALT+F4 on Windows. On Mac, move the mouse to the top and the close button appears. Not sure on Linux - will find out.
* Pre-requesties:-
* Think about whether you want to Reset/Backup the epidemic.
** You'll need a version of R installed. Add the statnet and animation packages in the normal way.
* Then power off things, and decide whether you want to charge them.
** Unzip the ndtv package into the library folder, inside your R installation.
* Drink tea.
** Install Java (JDK recommended) - any version 7 or later. Add the path to java.exe (C:\Program Files\Java\jdk1.8.0_05\bin) to the system path.
** Install PDFtk Server - a commandline set of tools for mangling PDFs. As part of the install, say yes, it should add the bin folder to the system path. #
** Install the dot matrix font, as the interface uses it to look, er, cool.
** Install GhostScript.
** Unzip the 64-bit VLC into C:\Program Files\VLC
** Remember to start a new command window after changing the system path!
* The Content
** Make a folder C:\Cent to put the content in - the name is a echo of the MRC Centenary events where all this began.
** Edit run_r.bat and mm.bat and check that the path to your R installation is correct.

Latest revision as of 13:45, 5 May 2017

Infected.jpg
Livenet.png
Epigraph.png

Introduction

The Barcode Epidemic is a game we've used many times, either to help us have conversations about epidemics with the people, or to have a bit of epidemic-based fun at an evening party. Its first outing was in June 2013 - MRC Centenary, Science Museum, although it is based on very successful previous events that basically did the same thing, but without using tablets and barcodes. It works well in groups of around 30+ people in a room, and also works well with a crowd passing through with a few minutes to spend with us. Usually we'd have 2 or 3 people with tablets playing the role of medics, or epidemic containment agents, perhaps in hazard suits. A person becomes infected by having a barcode (QR-code actually) give to them, and they are told to come to the medics with the red tablets to get the remedy. The barcodes get scanned, and the infector is sometimes given some kind of pleasant remedy for their infection. They also may be given a number of barcodes to give out, which represent them spreading their infection to others. Various epidemic statistics are displayed in real time as the epidemic progresses, and various conversations about epidemics might happen on the way.

The game depends on a bit of technology; setup from scratch can take a bit of time, but once it's all done, it's just a few things to plug in. Particularly: it needs a wireless network (perhaps a private router, or an onsite wifi if you can depend on IP addresses not changing), a laptop running a web server and the software to display all the stats, and a number of tablets to do the scanning.

New Installation

If something has gone wrong, or the Barcode Epidemic needs setting up on new equipment, then the following should be everything you need to know. I'll use the current equipment to describe the process; steps will differ with different equipment obviously, but the principles should still work!

Platforms

We've tested the web server and main display on Windows and Mac, and got it all working. No reason I can see why it shouldn't work on Linux as well, but we haven't tested that. I've only tested the barcode printing code on Windows; it's all Java, but as it talks to printers, there's more possibility that something might not work. (That's quite a crude bit of software as you'll see...)

The Web Server

We need to run a lightweight HTTP server that supports PHP, and we'll use it to run a tiny website that supports the communication and data collection. The same platform supports the Herd Immunity app, so I'll put the setup for the common web-related parts on a separate page: Web Platform for MRC Outreach Events. This includes setting up the server software and hardware.

The Live Display App

This is a small Java Application which can display a slideshow of graphs of the live epidemic data, interspaced perhaps with movies or images that might be interesting and attractive. One of the graphs is a network graph connecting people's contacts together, which relies on R.

Install Prerequesties

  • Java from Oracle.
  • R from R.
  • Inside R, we need the statnet package, so install that in the R interface.

Install and Configure the App

  • Download the app - either With Media or Without - v 3.01, 26/01/2017.
  • Extract it anywhere you like.
  • The big zip contains sample movies and images in the media folder. You can delete what you don't want, but leave pause.png in there!
  • If you want to translate the text on the graphs into new languages, look in the lang.txt file for instructions.
  • To configure the app and the slideshow, look in script.txt, which has instructions inline, but briefly:
    • Edit Language:EN if you want a different language. The one you choose must have matching references in the lang.txt file.
    • Edit TimeZone:GMT to match where you are, so that the graphs match the time the tablet thinks it is. GMT, or GMT+1, or any standard code is fine.
    • Edit WebFolder: to point to the folder where epi.csv and params.txt are found, where the Epi Webpage is served from.
    • Edit RScript: to point to where Rscript.exe is. (On Windows this is a full path, but Linux/Mac I think is just Rscript)
    • RNetGraph: must point to the R script that creates the network graph - shouldn't need changing, unless you want to make different sorts of network graph...
    • Lastly, between the Script: and Loop lines, is the set of things that the live app will display. See the instructions in the file, but briefly:
      • Movie["path/tomovie1.mp4","path/tomovie2.mp4"] - will play a one of these movies to completion on each cycle. The following cycle, it will play the next one...
      • Image["path/toimage1.jpg","path/toimage2.png"] - similar, but it will display a static image.
      • Wait 10 - will wait 10 seconds. Important, as without it, it will jump to the next part instantly.
  • Lastly, to run the app, you need to type java BarcodeEpidemic while you're in the folder you extracted everything to. Or click on the run.bat or run.sh scripts if you're in a GUI.
  • The app is full screen - to close it: Windows, press ALT+F4 together. Mac: move the mouse to the top of the screen, and a menu bar should appear.

The tablet

  • Talk to Wes or IT, to find the mystery unlock shape.
  • To set it up, you'll need to install two apps.
  • Connect it to a WiFi with internet access. If you're using the HP Slate 7, and you want to connect to the Imperial-WPA (or other Enterprise) network, then follow the special instructions on the HP Slate 7 2801 page.
  • Use Google Play Store to install an app called Pic2Shop
  • While you're there, you might as well do an update.
  • Then install the Live Epidemic App by using Chrome, view this page, and download the app Here. Then click the various confirmations that you want to open it and install it.
  • If the EpiScanner app is already installed, then run it, click on the menu (the three dots in the top right), and check for updates.
  • Test by turning on the router, and starting up the web server laptop. Join the mrc_outbreaks network on the tablet.
  • And in Chrome, browse to http://192.168.2.2 or whatever the server's IP address is. (See the instructions about the Web Platform for MRC Outreach Events). You should get our MRC page - if not, check you're really connected to mrc_outbreaks on the tablet, then verify the router and web server are running ok, and the IP addresses match.
  • Run the Epi Scanner app, and from the menu (three dots), choose "Set Server URL". You'll want something like http://192.168.2.2/epi.
  • Try scanning a barcode.

Making The Stickers

Barcodeprinter.jpg

A very crude Java app for making the stickers is available Here. Unzip it somewhere, and use run.bat or run.sh to run it. You'll get a screen full of parameters, and a go button. The labels we used for the first round were made by Niceday, 21 labels per sheet, 63.5mm x 38.1 mm, in boxes of 100 sheets. We found that the printers were not quite as precise as we wanted at printing exactly on the labels, so the parameters here are an example best fit.

  • First Bar-Code No is the serial number of the first barcode you want to print.
  • And Last Bar-Code No is obviously the last barcode you wan to print.
  • The Label Spacing (x and y) are distances from the left/top edge of one label, to the left/top edge of the next, in mm, multiplied by 10.
    • Horizontally, I made this 66.0mm - (not 63.5mm - there's a 2.5mm gap between labels), so the value is 660.
    • Vertically, I made it 38.5mm - the labels touch in the portrait direction.
  • Total labels width and height: basically assume labels are printable, non-labels are not, and measure the printable dimensions.
    • Horizontally, I made this 195.5mm (1955), which is 3*63.5 + 2*2.5
    • Vertically, I made this 267mm - 38.1mm * 7 plus a bit - the 38.1mm must be slightly underestimated.
  • The Bar code offsets are the positions of the top-left corner of the barcode, relative to the label. 19.2mm and 6.6mm respectively (192, 66) worked for me.
  • And the text offset is the distance from the top-left of the label, to the bottom-left of the text, for the ID number to be plotted. I had to guess this a bit, but 42mm and 35mm were about right.
  • Font size is the size of the ID number. 48 is quite nice.
  • The labels per sheet is obviously, the number of labels per sheet.
  • The URL preamble is the bit before the ID number that will get made into the QR code. The epidemic needs the full URL to end with something like ?id=1234, but before that it doesn't care. You can therefore make the barcode point to any site you like that doesn't make me adding that tag on the end.
  • And the background image is the backdrop for the label. Mine was a 635x381 pixel image, with a border cut out - Thinking at 100dpi.
  • Next, choose the printer.
  • And lastly, set the number of millimetres (not mm*10 for some reason), for the position of the top-left of the first label, relative to the page.
  • And there's a print button to set things going.
  • Your settings will be saved in a text file called qrmake.ini.

Setting up for an event

So, assuming all the hardware and software is installed, here's how to run the event.

Get the hardware ready

Assuming everything is ready and updated, so we don't need any internet access at this point.

  • Router on first.
  • Then turn on laptop, and join laptop to the private wifi.
  • If you're in Imperial, or somewhere the laptop has familiar wifi, it might be a good idea to forget those in case it decides to connect to them on a whim.
  • Turn tablets on, and connect them to the private wifi - again, you might want them to forget any other network they might be tempted towards.
  • Connect the laptop to the projector or display before running the live app - we don't want it changing resolutions mid flow.
  • And regarding TVs,
    • Make sure you've got the right cable, and test beforehand. For example, the TV in Pearl Liang, where we often have the short course social epidemic, doesn't support HDMI, even though it has the right ports, so use a VGA cable.
    • Also remember that if you use the beast (HP Elitebook 8760w, it has an HP DisplayPort, not a HDMI port.

Setting the parameters

Params.jpg
  • Browse to the Epi Platform page on whatever IP the laptop has got itself. (See earlier).
  • On the "Settings Params" page, here's what the parameters do.
    • The reproductive number. The number of new contacts each infector will make, is poisson distributed.
      • First parameter is the mean
      • Next is the ceiling and
      • finally, the floor.
    • The vaccination part. If you want conversations about vaccination to be part of the game, then:
      • Vaccination Probability is the probability of a person being vaccinated, if you ask the computer. (Which you can - see below)
      • Vaccination Efficacy is the probability that someome who has been vaccinated gets some benefit from it.
      • Vaccination Contact-Multipler is the effect of vaccination on the number of infections made, if a person is vaccinated, and it works for them.
    • Finally, the app settings.
      • Vacc button - both the Herd Immunity Tablet app, and the Barcode Scanning app can display a Vaccination button, and when you tap it, it changes to Yes or No depending on the vaccination probability defined above. If you want that button visible in the app, then say YES. Otherwise, if either you don't want to talk about vaccination, or if you have some other way of defining whether people have been vaccinated, set it to NO, and the button will disappear from the tablets.
      • Population Division or game-type. This option allows you to say, there are two types of people in the world, and when someone is infected, we ask them which kind they are. The effect of this is an extra pair of Scan/Type buttons appear on the android app, so you have one pair for each group of people. Also, some of the text labels on the analysis will change. The different game-types are:
        • Departmental - in which we distinguish between members of department, and visitors.
        • Gender - in which we distinguish between male and femals victims.
        • Vaccination - in which we distinguish between those who were vaccinated, and those who were not.
        • None - in which case all people are the same, you only get the one pair of buttons in the android app, and the analysis colours are less interesting.
  • So change all of these as you want, and then don't forget to click the Set button to save the changes.

Reset Previous Data

Reset.jpg

At some point, you'll need to clear the epidemic and start fresh.

  • Browse to the Epi Platform page again, and choose the "Reset" page.
  • The top entry is to do with the Herd Immunity game, so ignore that.
  • If you click the CLEAR button next to Live Epidemic, it will take a backup of whatever epidemic is currently running, and reset everything back to empty.
  • It might take a minute for all the changes to show up on the live display.

Run the Epidemic

  • Start the analysis app! (Run script, or java BarcodeEpidemic).
  • Seed the infection by giving someone in the crowd a barcode, and tell them to go to the medic with the tablet to get their cure.
  • The conversation with a new victim then goes along these lines.
    • Hello. You seem to have been infected with a disease. Bad luck.
    • For Gender, Department, or Vaccination games, observe, or discover the victim's gender, departmental, or vaccination status, so you can push the appropriate Scan button on the tablet.
    • For the Vaccination game, it depends how you want the game to run, but you might push the Vaccinated? button, wave the tablet mystically at the victim, then reveal to them whether they are vaccinated or not. And then tap the appropriate Scan button.
    • (For the None game, there's only one Scan button).
    • So, somehow, you push the right scan button, and point the rear camera at the victim's barcode. Then keep their ticket to one side.
    • The tablet will ask you to scan zero or more barcodes, one by one. Tap scan, scan the code. Tap scan, scan the code, etc.
    • For the Vaccination game, the tablet at this point may have said, "You were vaccinated, but..." - in which case you can talk about vaccination efficacy, coverage, etc.
    • Give the new barcodes to the victim, tell them to go and spread the infection.
    • And some messages for the victim:
      • They can look out for their number (which the scanner app shows, but is also printed on the barcode they gave you, which you kept to one side), and track their progress on the big screen.
      • Tell them they are now immune, but to keep that a secret. If someone tries to infect them again, take the barcode, but you don't have to see the medic.
      • Go and infect whoever you like, and tell them to come to the medics with the red tablet.
    • Remember to press the Send button at the end.
  • If you have problems scanning - the Type button lets you type in the number printed in a rather small typeface on the ticket. A torch/light can be a good idea.

Close-down

  • Close the live app with ALT+F4 on Windows. On Mac, move the mouse to the top and the close button appears. Not sure on Linux - will find out.
  • Think about whether you want to Reset/Backup the epidemic.
  • Then power off things, and decide whether you want to charge them.
  • Drink tea.