Home   Jensen Archive   jWiki   Jensen News   Jensen Cloud   Jensen Programming   Jensen Family Tree   JensenDiary

Corona Simulation

10/11/2020

This simulation of the Coronavirus in Spain was a resource for a debate in school where I had to be in favor of the lockdown and mask rules. At the end it wasn't clear if I had won or the ones who were against (Pablo Molinero and Manel GraƱa)

float deadProv = 36257f/(1240000f);
float outDays = 24;
float infectedRadius = 1;
float popDensity = 94; //94 Like Spain  7.3 Sant Pol
float spanishPopulation = 47329981;

int popNum = round(100*popDensity/7.3);
float infectProvPerFrame() {
  //if(totalDays>90){
  if (true) {
    float provSDist = map(socialDistanceRate, 0, 1, 0.128, 0.026);
    float provMR = map(maskRate, 0, 1, 0.174, 0.031);
    return provSDist+provMR;
  } else {
    float provSDist = map(0, 0, 1, 0.128, 0.026);
    float provMR = map(0, 0, 1, 0.174, 0.031);
    return provSDist+provMR;
  }
}

...

Need any help?

If you have a problem with this code, you can contact me at gerardjensenolmo@gmail.com