CSC107 - Lab 4
Termites and Segregation
Assigned Mar 1st
Due Mar 5th 5 pm
Show your work on all questions for full credit.
References
Termites
Question 1
We observe that there are 10,000 piles at the beginning of a termite simulation, and
after 4000 ticks, there are 3000 piles remaining. What percentage of piles are
being eliminated every timestep?
Question 2
Assume our termites can eliminate 20% of the piles every 30 ticks. Starting with 4000
piles, how many piles are there remaining after 3000 ticks?
Question 3
From the original model, change the setup procedure to make two types of wood, yellow and red.
Rewrite the other procedures to have the termites eventually sort the pieces
into two piles. Turn in a printout of your new procedures.
Segregation
Question 5
From the original model, in the setup procedure, change the code to have three different types of turtles
instead of two, with the new color being gray. These individuals should be
distributed equally, such that 1/3 are yellow, 1/3 are red, and 1/3 are grey.
Add another color of circle, distribute 1/3, 1/3, 1/3.
Describe how this affects
the behavior of the model with different levels of similarity preference in terms of
the resulting average similarity and the time to convergence.
Draw a graph of the similarity at convergence versus the starting similarity required, using increments of 10%
for the similarity.
Turn in a printout of your new procedures.
Question 6
From the original model, add a slider for a new number, the diversity preference
of the individuals, which is a percentage from 0 to 100. An individual will
only be happy now if they are above their similarity preference and below their
diversity preference.
How does this affect the model in terms of the
resulting average similartiy and the time to convergence?
Draw a graph of the similarity at convergence versus the starting similarity
required, using increments of 10%
for the starting similarity, and using a starting diversity of 90%. Clearly state if there is no convergence.
Turn in a printout of your new procedures.
Extra Credit
Question 4
From the counting model, alter the code to have the termites pick up two pieces of
wood before dropping them both when they hit the next pile. How does this change
the rate of decay for the number of piles? Calculate after 1000 timesteps and 10,000
timesteps for both the original and extended models. Turn in a printout of your new procedures.
© Mark Goadrich 2010, Centenary College of Louisiana