Assigned Jan 16th
Due Jan 16th
In this lab, we will learn the basics of Starlogo TNG, using agents to paint the world, and
learn about the
Starlogo TNG Documentation.
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