1) Consider the Netlogo Statement Below, How Often Is My Procedure Called?

1) Consider the Netlogo Statement Below, How Often Is My Procedure Called?

CS108L Spring 2014

Week 13 Quiz

1) Consider the NetLogo statement below, how often is my procedure called?

  1. myProcedure is always called.
  2. myProcedure is never called.
  3. myProcedure is called about 10% of the time.
  4. ***myProcedure is called about 1% of the time.
  5. 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?

  1. Make the newly born fish stay near their parents.
  2. Decrease the growth rate of plankton.
  3. ***Decrease the birth rate of fish.
  4. Increase the movement speed of fish.
  5. 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______:

  1. only exactly like the real-world original when an analog process is used.
  2. only exactly like the real-world original when lossless compression is used.
  3. only exactly like the real-world original when a digital process is used.
  4. only exactly like the real-world original when the image is NOT digitally edited (no “Photoshopping” of the image is allowed).
  5. ****a model of the real-world and all models are abstractions.

4) Within a NetLogo procedure, the code below will fail unless

  1. An agentset is called first.
  2. The programmer has defined “turtles” as a breed.
  3. ***”Energy” is defined as a turtles-own variable.
  4. 10 is not larger than the maximum value defined for energy.
  5. 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?

  1. ****Inside any “ask turtle“ or “ask“ breed code block, inside the square brackets.
  2. After “reset-ticks“ in the “go” procedure.
  3. Inside a certain procedure, the “go” procedure.
  4. After you define the breeds used at the beginning of the program using the “breed” keyword.
  5. 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?

  1. 10
  2. 15
  3. ***3
  4. Change the word “energy“ to a slider
  5. It is not possible

7) Why does the following code fail?

  1. Because “Growing” has not been defined.
  2. Because “Repeat” is not a command.
  3. *** Because “set color” cannot be outside of an “ask turtles” block.
  4. Because “Repeat” cannot be inside an “ask turtles” block.
  5. Because “Count” can only be used with an agentset.

8) What is the final value of n in the NetLogo code below?

  1. -2
  2. ***8
  3. 10
  4. 5
  5. 2

9) The code below will fail UNLESS:

  1. An agentset is called first.
  2. “Fishy” is defined as a breed or agentset.
  3. Energy is defined as a turtles-own, fishies-own.
  4. You use reset-ticks in the setup procedure.
  5. ***B and C

10) Which of the following statements are true of the command “tick”.

  1. Requires that reset-ticks is called before you can use it.
  2. Is a built-in counter that you read with the command ticks
  3. Automatically initiates a plotting of all of the plot pens in a plot.
  4. It is usually found in a go procedure
  5. ***All of the above