2014-12-04 Classwork + HW

posted Dec 3, 2014, 9:06 PM by Samuel Konstantinovich   [ updated Dec 3, 2014, 9:06 PM ]
Homework:
Tutorial Videos 19, 16, 20
Complete any remaining lab!

Classwork:
1. While working post at least one question or answer on piazza DURING THE CLASS.
Remember there are no stupid questions, but there are people that get lower test grades that can be avoided by asking for help early.  

You can of course post more than one, and also do something at home, but you are mandated to participate in class. When your question is resolved you must mark it as resolved.

2 . Complete your work from yesterday then add more:

New Variables:
1. There should be global variables accidentDeath and naturalDeath. These variables will act as a counters for the number of deaths that happened by getting hit by a car, or dying naturally.

2. Each turtle should have a variable age that determines how many ticks the turtle has been alive for.

New Widgets:
Make two 'monitor' widgets on your netlogo interface. This will display the number of accidentDeaths, and another will display the naturalDeaths Just put the name of the variable into the monitor, there is nothing fancy here.

Additional Car Behavior:
When a car is on the same patch as a person, it makes the person die right away. This will add 1 to the accidentDeath count.

Additional People Behavior:
1. People have an 1% chance of hatching a new person. The child should turn 90 degrees to the left  so they split apart from the parent quickly. (see the hatch command)

2. People add 1 to their age every time they move. 

3. People that are over 100  ticks old have a chance to die every time they move.

3a. This chance is equal to:   1% per year over 100.  This requires a little math, but you can do it! 
e.g.
age 101 has a 1% chance of death. 
age 110 has a 10% chance of death.

3b. This type of death is a natural death and should add 1 to the naturalDeath counter.

4. If there is time, and sound (use headphones) you may check out the new tutorials. 


Comments