EES 4760/5760

## Homework

### Preliminary Information

Some problems in this homework set call for you to write a NetLogo model and also answer questions about the model. For answering the questions, you may take any of these approaches:

1. Edit the INFO page for your NetLogo model and add the following (this example is for exercise 5.4)

# Exercise 5.4

When I ran the model ...
2. Write your answer in a Word file or other document file (text, PDF, etc.) with the title homework_answers.docx and put the homework answers in there, as follows:

Exercise 5.4: When I ran the model …

3. If your answers include diagrams or other kinds of figures or illustrations that are a pain to do in Word, you can hand-write your answers (legibly!), take a photo of them, and upload the photo.

### Homework Exercises:

• Everyone:
• Railsback & Grimm, Ch. 4, Ex. 4.2, 4.4

For exercise 4.4, instead of the way the exercise is described in the book, do the following:

• Try adding “noise” to the landscape by adding a random number to the patch elevation.
1. Add a switch to the interface and call it “noise”

2. In the ask patches statement in to setup, change the elevation to this:

ask patches
[
set elevation 200 + (100 * (sin (pxcor * 3.8) +
sin (pycor * 3.8)))
if noise [
set elevation elevation +
random-float 20.0 - 10.0
]
set pcolor scale-color green elevation 0 400
]
3. In the crt statementin to setup (where you create the turtles), instead of setxy random-pxcor random-pycor write setxy 71 71 to start the turtles in the middle of the hills. Write up answers to the following questions and turn them in on Brightspace:

4. Compare the turtle behavior with noise off to noise on for several values of q. How does the noise affect the movement?

5. Does this give you any insight into why the paths in the original (noise-free) model look artificial and unlike what you might expect butterflies to do in the real world?

• Railsback & Grimm, Ch. 5, Ex. 5.1, 5.2, 5.4, and 5.7.

• Graduate Students, also do the following:
• Railsback & Grimm, Ch. 5, exercises 5.5 and 5.8

### Notes on Homework:

• Everyone: When there is more than one file for a homework assignment, I recommend that you make a Zip file containing all of the files for the different parts of the assignment and upload the Zip file to Brighspace instead of uploading the files separately. When a homework assignment has more than one problem, and each problem has multiple files, it can be helpful to have a separate folder for each problem, and put all of these folders into the ZIP file that you turn in.

There are many free software apps for creating and working with Zip files, such as 7Zip for Windows and Keka and iZip for Mac.

For exercise 5.1, you should have three versions of the model. Each version adds new changes on top of the previous version:

• one version of the model that incorporates all the changes (listed with triangular bullets in the book) in section 5.2 (pp. 64–68),
• one version that starts with the previous version from 5.2 and also incorporates the additional changes in section 5.4 (p. 70),
• one version that starts with the previous version from 5.4 and also incorporates the additional changes in section 5.5 (p. 73)

For exercise 5.2, look in the NetLogo dictionary for a command that does what you want. The point of this exercise is to start getting you used to looking for new NetLogo commands when you want to do something you haven’t yet learned about.

Exercises 5.4 and 5.7 ask you to answer a question about the modified model. Be sure to turn in an answer to the question:

Here are three possibilities:

1. Edit the INFO page for your NetLogo model and add the following (this example is for exercise 5.4)

# Exercise 5.4

When I ran the model ...
2. Write your answer in a Word file or other document file (text, PDF, etc.) and put the homework answers there. You can either make a separate document for each exercise (e.g., answers for exercise 5.4 go in ex_5_4.docx, answers for exercise 5.7 go in ex_5_7.docx), or you can make a single document file (e.g., with the title homework_5_answers.docx) and put the homework answers in there, as follows:

• Exercise 5.4: When I changed the value of q, …
• Exercise 5.7: If the butterflies stop when they reach a patch that has no higher neighbors …
3. If your answers include diagrams or other kinds of figures or illustrations that are a pain to do in Word, you can hand-write your answers (legibly!), take a photo of them, and upload the photo.