siteIcon

Tech Novice Tools

Processing Apps

burgerIcon

Simulitis Sagavirus

Stage 5: Fine-Tuning Infection

About this stage

In this stage, we fine-tuned the infection by including elapsed time and probability of infection. We also normalized the hotspot radius for each of the two canvas sizes. We also added a Frame Rate slider to change the speed of the animation. The 'Speed Slider' is now only used to initialize the speeds of Blues before running the simulation.

Blues can still not transmit the infection to others and can neither recover or die from Simulitus. We hope to cough up that code very shortly!

Ponder Points (Simulitis ~ Stage 5)

  1. There's a pun lurking around on this page somewhere. Where is it? After all, we are dealing with a 'pundemic' aren't we?!
  2. Our tireless development team made a copy of a previous stage and pasted/renamed it for a new stage. They spent hours on the new stage's JavaScript, but none of it was working when they loaded the web page. What is a possible explanation for none of the changes appearing?
  3. On a desktop device, make the browser window as small as possible and enlarge the hotspot radius to it's largest value. What is it? Now make the browser window large enough so that the canvas gets bigger. Refresh and make the hotspot radius as large as possible. What is the value now? Visually, the radius is the same in each canvas size. What does its maximum value represent relative to the canvas? There is a single line of code in the sketch5.js document in the setup() function that achieves this result. What is it? Discuss it from an 'object' point of view.
  4. If we wanted to set the minimum hotspot radius to be 1/8 of the canvas width (no matter what the canvas size is), what command would we need? It hasn't been done yet.
  5. Refresh the app and without hitting the 'Go!' button, move the hotspot radius to half-way on the slider and open the stats panel. What do you notice? What is the funny wavy symbol mean? What is the function that is doing this work? Why are there only 2 decimal places showing...how did the coders make that happen? So many questions!
  6. What code would you need to write to see the approximate percentage for infected Blues as well?
  7. In previous stages, we noticed that when the speed control was changed during a simulation, the Blues trajectories acted 'weirdly,' even though they did change their speed. Confirm that the Blue speed control is not inactive during a simulation, and that the new control, Frame Rate, does in fact, speed or slow the animation. What is the default frame rate? What Processing command activates that frame rate?
  8. In the init function, look carefully at the frameRateSlider.oninput = function () code block. There is a very curious command:
    myRate *= 1.0;
    Mathematically, it does nothing, but without it (and the line was marked with a 'eureka' comment above it,so it must be important), the frame rate is not changed although there are no errors that come up in the Developer Tools. What's going on with that line of code?!!!
  9. What is an abbreviated history behind the word 'eureka' as mentioned above?
  10. Refresh the simulation and hit "Go!" and watch the Elapsed time in the stats area. Move the Frame Rate slider around and watch the effect on the elapsed time. Is it behaving the way it should?
  11. Refresh the app and set the population to 100, with a speed of 3, hotspot radius of 50 and an infection probability of 100%. Slow the frame rate to about 10. According to these settings, any Blue entering the hotspot will be infected. Watch the slow motion events of a Blue entering the hotspot. At what point does it turn green? Watch several to confirm your hypothesis.
  12. Do the same as before but this time us an infection probability of 50%. If you are right, 1 out of 2 times a Blue will exit the hotspot showing an infection.
  13. If you compare sketch4.js with sketch5.js, you will notice we added another attribute to the Blue properties. What is it? See if you can find where we used it and make a guess as to what it is doing for us to cause the behavior we saw in the previous Ponder Point.
  14. Can the infection probability be changed while the simulation is running? If so, do the changes you observe make sense. Describe the scenario you invented to draw your conclusion(s).

Last update: 03/16/20


Controls:

Population:

Speed:

Hotspot Radius:

Infection Probabability:

Frame Rate:

Stats:

Elapsed time:
Healthy:
Infected: