About this stage
The 'Blues' have a lot to be blue about; There's a 'Simulitis' hotspot in the upper left corner, and any Blue that enters it, gets infected with the virus!!!
At this stage, Blues do not transmit the infection to other Blues, and the infection never goes away. However, Blues don't die from it.
You can control the radius of the hotspot in the interface using the Hotspot Radius slider.
Ponder Points (Simulitis ~ Stage 4)
- Play with the simulation for a bit and once you see what's happening, go back to Stage 3 and examine the HTML code that creates the populationSlider. Write it down. (Including its div container, it's about 5 lines long.) See if you can mimic it and write a similar code block for 'Hotspot Radius.' When you have your answer, look at the Stage 4 HTML source code here and see how we did it. Was your work similar?
- Do the same thing for the JavaScript code in Stage 3 (sketch3.js) and see how we setup the code for the speedSlider. Find all the pertinent code. See if you can mimic it for the Hotspot Radius code. When you have committed yourself, look at sketch4.js in this stage. Were you successful? Close?
- Reset the app and grow/shrink the hotspot radius, without pushing the 'Go!' button. What happens? Look at the stats panel to confirm your observation.
- Reset the app and make the population and the hotspot radius as large as possible. To the nearest whole percentage, what percent of the population is overtaken by the hotspot? Be sure to do this calculation for each browser window size. (The app supports two sizes; you may have to refresh the page as you change the browser window size). What would we have to do to make this percentage the same for each window size?
- Find the updateStats function. Can you rewrite it to where it will show the number of healthy and infected Blues as well as their percentages?
- Currently, if a Blue enters the hotspot region, there is a 100% chance it will be infected with Simulitus. Explain what you think we would have to do to have a variable infection rate in a range from zero to 100%. Where all would it be implemented? What variables might we need? Be as specific as possible.
- To examine the infection rate, we will need to keep track of the elapsed time of the simulation. Suggest what changes we might have to make to this stage to get this to happen. Where would be a good place to output that information?
- Look at the controls area and notice the two headings highlighted with a turquoise-type background color. Find the lines of code in the HTML that created these headings. What was the complete CSS rule that provided the style for each heading?
- What is responsible in the HTML code for numbering our 'Ponder Points'?
Last update: 03/16/20
Stats:
Healthy:
Infected: