Assigned Mar 14th 10am
Take-Home Due Mar 16th, 10am
You are not allowed to use the internet in general for this exam, except for the
Starlogo TNG Documentation.
You may use your notes and previous models we have written in class.
You may use the computer to execute your model.
You are bound by the Honor Code for this exam, which you need to sign.
Take Home
Question 1
You are an artist interested in creating collaborative abstract art.
You have hired the turtles to paint their world and make paintings for you.
- Open an empty model in StarLogo TNG.
- Set up the world so that there are 30 each of
two colors of turtles, red and white.
- Scatter the turtles randomly in the world.
Question 2
You must next add code to have the turtles paint the world. The turtles follow a simple rule:
if they see an empty (green) patch, paint it with their own color, then wiggle. You need to
- Draw a state transition diagram to describe this behavior.
- Create a Wiggle procedure
- Create a Paint procedure (use an if statement)
- Add a forever block that includes these two procedures
Run this model and report on the resulting painting in the world.
Question 3
You hire another set of turtles, but they are not entirely reliable. As before, if they see
a green patch, they color it with their color, but if they see
a patch that is already colored but is not their own color, they change into that color and start
painting with this new color. For example, a red turtle encounters a white patch, causing it to
become a white turtle. This turtle is now painting green patches white.
- Draw a state transition diagram to describe this behavior.
- Create a Paint2 procedure (use if statements)
- Replace Paint with Paint2 in your forever block
Run this model. Discuss any differences between the paintings from the turtles in Question 2 and Question 3.
Question 4
You hire a third set of turtles, which follow a slightly different set of rules. If they encounter
a green patch, they paint it their color, but if they encounter a colored patch that is not their
own, they first change into that color then color this patch green. For example, a red turtle
encounters a white patch, causing it to become a white turtle and paint the white patch green, and
this turtle is now painting green patches white.
- Draw a state transition diagram to describe this behavior.
- Create a Paint3 procedure (use if statements)
- Replace Paint2 with Paint3 in your forever block
Run this model. Discuss any differences
between this model and the models in Questions 2 and Questions 3. Why do you think this model behaves
the way it does? Which pictures do you prefer and why?
You Must Turn In
- Procedures and state diagram from Q2
- Procedures and state diagram from Q3
- Procedures and state diagram from Q4
- Qualitative discussion of differences between Q2 and Q3
- Qualitative discussion of differences between Q2, Q3 and Q4