ViralSpread 2.5 is now available, adding graph axis labels and the ability to export graph data to CSV files for manipulation in Excel. (There’s an additional fix in master for incorrect exporting of data for the virus count graph.)
At this point I’m pretty happy with the features and stability of the program. The roadmap has a few additional features on it related to changing the movement and contagion behavior of the nodes, but nothing major — everything is pretty mature as-is I think. Moving forward it’s time to basically run the program lots of times and see if I can learn anything from the data it produces. I’m also going to write a few posts about some of the things I learned and design patterns I used while building ViralSpread.
The screenshot here is of the graph dialog.
Done with ViralSpread 2.0! Compared to 1.0, I’ve mostly added support for showing (and saving) 10 different graphs while the simulation is running, as opposed to just 1 graph when the simulation ends. You can also save the graphs. Additionally I added the diameter of the largest connected component to the statistics. Download the source and executable JAR file from github: https://github.com/IceCreamYou/ViralSpread
I’m done with Version 1.0 of ViralSpread, the new project that branched from Contagion. The code is on github and I added a compiled JAR file to it (plus a screenshot) so you can just download and run it.
I’m not quite sure what are the right questions to ask in order to learn something useful from my simulation because I don’t exactly have my finger on the pulse of the network science community. But I figure it makes sense to start at the goals — the things network science could be useful for, like predicting and preventing the spread of diseases, fixing electrical grid structural instabilities, and creating effective marketing. In other words, we’re interested in HOW FAST a virus spreads TO WHOM under WHAT CONDITIONS. That implies the questions:
Given a set of conditions, how fast does the virus reach “critical mass”?
What is the probability that a specific node gets the virus? How soon will that happen? How does this depend on the node’s “neighbors,” to the extent such a concept exists?
What conditions cause the virus to spread faster or slower?
Is there a set of possible conditions that makes hitting a tipping point very likely? If so, how do we identify those conditions?
How can we change the structure or properties of the network so that a tipping point does or does not occur?
Do certain easily observable conditions indicate a specific model we can use to predict networks without the actual node data?
Are tipping points related to specific nodes, or the overall network, or just neighbors…? In other words, can we generalize about the role of individual nodes, or do different nodes have significantly different roles?
From there, we can get more specific about exactly which properties we’re looking for. I’m not sure what I’m looking for yet but I do want to be able to walk away from this saying I learned something more than a set of statistics.
It’s been a long time since the last update. I put the Contagion project aside over the summer while I was working on some other social networking software.
But I’m back in school and I’m taking a class called A Networked Life taught by Michael Kearns. Two of the textbooks are books I’d already read that inspired the Contagion project — The Six Degrees by Duncan Watts and The Tipping Point by Malcolm Gladwell. So I was excited to take the class because it addresses head-on the topics I’d thought were fascinating enough to start Contagion.
Long story short, I decided that I was getting too hung up in the complicated UI Contagion required, and that there were much simpler approaches I could take to start with that would still yield interesting results. So I’m adding the game element later (the part where you can walk around and interact with the world instead of just observing it) and restricting the world to a fixed size where all of it is displayed on the screen. The result is a bunch of dots (“people”) that move around and collide with each other. With a certain probability they will transfer a “virus” (their color) to the a “person” they collide with.
This setup lets us study questions about competing viruses, like how fast viruses will spread, how the spread depends on movement (speed and strategy), the way the number of competitors affects the spread of a virus, etc.
The program is functional, but I want to expose a lot more statistics about the simulation in the panel on the right. I also want to be able to visualize connections, where a connection is defined between two people when one of them spread a virus to the other and the other has not adopted another virus since that occurred.
I’ve been reading more of Duncan Watts’ The Six Degrees and it’s given me a lot of good ideas and things to think about for Contagion. One thing Watts seems not to address in his study of networks is the influence of authority — that is, the idea that some people know more than others about certain topics and so their opinion on those topics is worth more (has a heavier weight) than others’ opinions on those topics. I haven’t finished the book yet, so it’s possible he does eventually discuss that, but it’s one interesting question that I might use this game to research.
Today I added other characters to the game world. The player can’t interact with them yet, but at least they’re being generated nicely (with randomly assigned behaviors and locations that are nicely distributed). The next priorities:
Let the player see the other characters’ properties when mousing over them.
Let the player interact with other characters by being close to them or by clicking on them for a menu of interaction options.
Allow the other players to move around and interact with each other.
Create various environment types that affect characters’ interactions.
Program a way for the various environment types to be randomly distributed over a level without looking too random.
Add a temporary way to tell the player when the game has been “won” — that is, when every character has caught the player’s virus.
Let the player define her own character’s characteristics when the game starts.
Let the player save the game.
Add ways for the player (and other characters) to improve their attributes.
At this point I should be more or less ready to release Version 1.0 so I can get some feedback and see how people are playing the game. In the next version, in addition to tweaks to character/virus/environment/item behavior, I want to add:
Write a better winning sequence: when every character in the world has caught the player’s virus, the world expands and more influential characters are introduced.
Add more ways for the player (and other characters) to improve their attributes.
Create various items that affect characters’ interactions, and a store where items can be acquired.
Better graphics for characters, items, and environment types.
More ways influence can be affected, such as by the number of other characters nearby with the same virus.
The ability to walk “through a door” or “up the stairs” and be teleported to a different world.
The ability for characters to have property (like a house) where others rarely go and where they are more influential.
Graphical tweaks, like making players’ color reflect their current state, and being able to zoom in and out.
More interactive interaction options between characters.
Contagion is a game inspired by network science where the player moves around in a 2D world, interacting with other characters in order to spread a “virus” of some sort. Different characters and viruses have different behaviors, and environmental conditions affect these behaviors as well. The player’s goal is to spread a virus as far and wide as possible; the game’s purpose is both for entertainment and to study how different behaviors contribute to different network dynamics (in other words, to see how viruses spread under certain conditions). The word “virus” is a placeholder here; types of viruses in the game may include ideas, religion, diseases, skills, and others.
I started writing this game in part as a response to Duncan Watts’ book Six Degrees and his criticism of Malcolm Gladwell’s The Tipping Point, but I have been interested in network dynamics for a long time. Over the last 3 years I have been writing open-source social networking software for websites in part as an exploration of what gets users engaged with a website and with each other. I’ve become increasingly interested in how users spread ideas and influence, so this game is a way for me to study that (plus, I just like writing games).
I’m an undergraduate student at the Wharton School at the University of Pennsylvania. I have a lot of diverse interests and hobbies. You can find out more about me on my website or on Twitter.
I’ll leave you with two goodies: the source code for what I’ve got so far on GitHub (not much) and a screenshot of the very preliminary UI so far (which sucks).