MTGermany / CoronaSim

Macroscopic simulation of the Covid-19 dynamics
https://corona-simulation.de
2 stars 1 forks source link

MTGermany/CoronaSim

Source code for the macroscopic interactive Javascript simulation at corona-simulation.de. The aggregation level is one country. Several interesting countries such as Germany, Switzerland, Sweden, the US, or India can be chosen. For model details and usage of the simulator including some examples see the info page of corona-simulation.de

Running the Simulation

This simulation uses JavaScript together with html5.

The simulation is driven by index.html which starts the actual simulation coded in corona.js and corona_gui.js

At initialization, the canvas referenced by

 <canvas id="myCanvas"...>some text for old browsers </canvas>

is defined and its size adapted to the viewport. Furthermore, the html drives some initialization via

 <body onload="startup()"> 

Data Used

This project uses the Covid-19 data that have been brought into the json format by the ressources of the Github repo pomber/covid19

Programm Files and Structure

The javascript code uses the pseudo objects CoronaSim and DrawSim that do what is expected by their names. Particularly, both have a method .updateOneDay that defines the timestep: one day:

The model and the pseudo-class CoronaSim

TODO

Pseudo-class DrawSim

GUI: file corona_gui.js