CS108L Spring 2014
Week 13 Quiz
1) Consider the NetLogo statement below, how often is my procedure called?
- myProcedure is always called.
- myProcedure is never called.
- myProcedure is called about 10% of the time.
- ***myProcedure is called about 1% of the time.
- myProcedure is called about 10 times.
2) Suppose we build a model of fish eating plankton. The fish gain energy by eating plankton and loose energy by moving or giving birth. When the model is run, at first the fish population greatly increases and the plankton population drops to near zero. Then, the fish population falls to zero because all the fish die of starvation and their energy drops to zero. Which change is most likely to make the fish and plankton populations more stable?
- Make the newly born fish stay near their parents.
- Decrease the growth rate of plankton.
- ***Decrease the birth rate of fish.
- Increase the movement speed of fish.
- Increase the energy fish use when they move.
3) In chapter 3 of Blown to Bits, the authors Lewis, Ledeen and Abelson, claim that a photograph is______:
- only exactly like the real-world original when an analog process is used.
- only exactly like the real-world original when lossless compression is used.
- only exactly like the real-world original when a digital process is used.
- only exactly like the real-world original when the image is NOT digitally edited (no “Photoshopping” of the image is allowed).
- ****a model of the real-world and all models are abstractions.
4) Within a NetLogo procedure, the code below will fail unless
- An agentset is called first.
- The programmer has defined “turtles” as a breed.
- ***”Energy” is defined as a turtles-own variable.
- 10 is not larger than the maximum value defined for energy.
- The programmer does not call please before the ask command.
5) In Netlogo, the code below can only be used in which of the following circumstances?
- ****Inside any “ask turtle“ or “ask“ breed code block, inside the square brackets.
- After “reset-ticks“ in the “go” procedure.
- Inside a certain procedure, the “go” procedure.
- After you define the breeds used at the beginning of the program using the “breed” keyword.
- Inside an “ask-patches“ block.
6) One way to make using a model easier is to create sliders so that the variables you are studying can be easily changed at the code interface instead inside the code itself. Consider the code below, if the modeler wanted to study how the amount of energy lost to a parent each time they give birth effects fish population WHICH NUMBER should be changed to a variable by creating a slider for it on the interface?
- Change the word “energy“ to a slider
- It is not possible
7) Why does the following code fail?
- Because “Growing” has not been defined.
- Because “Repeat” is not a command.
- *** Because “set color” cannot be outside of an “ask turtles” block.
- Because “Repeat” cannot be inside an “ask turtles” block.
- Because “Count” can only be used with an agentset.
8) What is the final value of n in the NetLogo code below?
9) The code below will fail UNLESS:
- An agentset is called first.
- “Fishy” is defined as a breed or agentset.
- Energy is defined as a turtles-own, fishies-own.
- You use reset-ticks in the setup procedure.
- ***B and C
10) Which of the following statements are true of the command “tick”.
- Requires that reset-ticks is called before you can use it.
- Is a built-in counter that you read with the command ticks
- Automatically initiates a plotting of all of the plot pens in a plot.
- It is usually found in a go procedure
- ***All of the above