Creating a Computer Virus Model
Objective: Students will learn about the spread of a computer virus through computer modeling.
Materials: Each student will need
Step One
-
Start off with interface: make go and setup buttons
-
Explain what setup and go mean, then add code for setup and go. As you call for new methods,
also create them. The emphasis should be on good syntax and code structure.
-
Help students create a working model where the virus spreads to computer.
-
Allow students to edit their graphics.
Code for step one can be downloaded
here
Step Two
Ask students the following questions:
-
Is this a realistic model?
-
Do all computers "catch" the virus?
-
Do computers ever "recover"?
-
Have the students add the ability for computers to "recover". Add sliders for the number of
computers, number of bugs, infectiousness, and recovery rate.
-
If there are specific graphics for recovered/sick/healthy computers, create breeds as
necessary.
Code for step two can be downloaded
here
Step Three
-
Create "immunity". Create a "counter" to kill the computers.
-
Create a plot of all the populations. Have students change parameters and play with the
model.
Code for step three can be downloaded
here