Coder Social home page Coder Social logo

epidemic-simulator's Introduction

Epidemic Simulator

A JavaScript-based simulator that models an epidemic in a village under very simple parameters.

Created by Ben Babcock as an investigative activity or homework assignment.

Try it out here.

Screenshot of the epidemic simulator's control panel and canvas grid.

Students can conduct a number of trials with the same settings, then adjust a variable and make a hypothesis about how their change will affect the epidemic. If students are familiar with mean and standard deviation, they can use these statistics to support their reasoning. Even if they aren't, they will still be able to develop an understanding of the effects of each variable as they play with the simulator.

Inspiration

I wanted to use the Epidemic Modelling activity on the NRICH website as part of a lesson on experimental probability. I love NRICH, and this activity was just what I needed.

As cool as it wasy, however, it was made in Flash. You can't zoom or resize anything, and forget about using it on modern mobile devices. I could use it, sure, but I thought I might be able to make something even better that didn't rely on Flash.

JavaScript is not my ordinary jam. I'm more of a Python/PHP backend kind of person—but I wanted something that would run in the browser and could be packaged up and hosted anywhere. This was a great opportunity for me to learn a little more about using JavaScript. Learning how to manipulate the canvas element with jCanvas was even easier than I thought it would be.

Browser Support

Developed and extensively tested in Google Chrome 40+ and Firefox 34+.

Because I am using the canvas element and jQuery 2.x, Internet Explorer 8 is not supported. IE 9 works but isn't pretty (because I'm using Flexbox). IE 10 is passable, and IE 11 should be all right.

If you're in a school setting and working on computers older than most of the teachers in the building, don't worry: just get your students to use their phones. The simulator is mobile-friendly, so a decent Android device or iPhone should do the trick.

Uncopyrighted

I'm putting this in the public domain so you can hack on it any way you please. Note that the jQuery and jCanvas libraries are under the MIT License, however; you must keep their copyright notices intact.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.