Populate the World

First we need to populate our world with Tasmanian Devils. 

Go to Edit Breeds.  Choose a suitable breed without a skin and rename it Devils. It is important to choose a model without a skin because we later want to use colours to show infected or healthy animals.
Move to the Everyone workspace.  Go to Variables and drag a shared number block onto the workspace. This will store the number of Devils in the world. Rename it population size.
Move to the Setup workspace.  Drag a Setup block onto it. Add a Clear Everyone block.

Goto My Blocks>Everyone and drag on a set population size block. Attach a number block and set it to be 200. (Hint:  You can quickly create a number block by just typing the number onto a blank workspace area)

Goto My Blocks>Devils and drag a Create Devils Do block out.  The number should be changed to population size.  Under Traits find a set color block, and set it to be black.

Then drag a scatter Devils block from the My Blocks>Devils section. 

Switch to SpaceLand to view your world.

Make the Devils Move

The next step is to make the Devils move around randomly in the world. 
 

Drag a Procedure block onto the Devils workspace.  Rename it Move.

Attach Left and Right Movement blocks to it.  They are set to 90, but we want the Devils to move randomly, so change these to random 90.

Add a forward 1 step block.

Change to the Runtime area.

From the Setup tab, drag a Forever block onto the Runtime area.

From My Blocks > Devils, drag out a Devils Move block and join it on.

Change to the SpaceLand window.  Click Setup to make your Devils appear, then click Forever to make them move.

Setup the Infection

The initial rate of infection will be able to range from 0 to 100%.  It will be stored in a variable and set by using a slider control.

To determine if an individual Devil is infected, we will generate a random number between 1 and 100.  If that number is less than or equal to the infection rate, then the Devil will be infected.

Move to the Everyone workspace and drag out a Slider control. Attach a shared number variable to it.  Name it Infection Rate.

 

Switch to SpaceLand and change the upper limit for Infection Rate to 100.

 

Go to the Setup workspace.  We no longer want all Devils to be black. Infected ones will be red. Alter the Setup so it appears like this:

Switch to SpaceLand.  Set an infection rate and test it.