Concept 2: Not as obvious as I had originally expected, you can make something happen randomly, by giving it a Random % chance to do something.

To make a boolean true 57% of the time you would say: random 100 < 57

To make a boolean true 33% of the time you would say: random 100 < 33 OR: random 3 = 0 (if you wanted 33.3333%)

You can use this in an if statement like this:

if random 100 < 50

[fd 2] ;50% of the time move forward 2

or like this:

if random 100 < N

[commands]

;N % of the time, do the commands

Concept 2.5:

The N from the last concept could be a variable OR REPORTER FUNCTION like this:

if random 100 < calculateProbability a b

[ do stuff in here ]

; where calculateProbability takes 2 arguments, and reports a number from 0-100 inclusive

Concept 3:You can give turtles more properties, like an individual speed, or individual health, or individual scores.

Variables (from the video)

Turtle variables are local to the turtle. Look up the turtles-own command.

This would have values like an individual person's name, age, height etc.

Global variables are shared by everyone. Look up the globals command.

This would have values like the world population limit, the speed limit everyone follows or other things that EVERYONE share. (Science/Math constants are global variables)

You can give a variable a specific value with set like:

set size 6

set color red

OR increase/decrease like this:

set heading heading + 1

set size size - .5

SECTION III

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 eaten by a cow, or dying naturally. Clear-all will reset them to 0. Turtles dying will increase them.

2. Each turtle should have a variable age that determines how many times they have been alive when their motion command was called. This is just a counter that keeps track of how many times it has run the motion command, so you can increment it in peopleMotion / cowMotion.

New Widgets:

Make two sliders: startingPeople, startingCows

They control how many cows/people are created in the setup.

Make three 'monitor' widgets on your NetLogo interface.

Display the

-accidentDeaths (Just put the name of the variable into the monitor.)

-naturalDeaths

-number of people shaped turtles (count them!)

Additional cowMotion features:

When a cow is on the same patch as a person, it makes the person die right away AND adds 1 to the accidentDeath count.

Additional peopleMotion features:

1. Add 1 to the turtle's age.

2. (birth) 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)

3. (death) People that are over 100 ticks old have a chance to die every time you call the peopleMotion command.

(aka: every time you call go / every frame / every tick , these all mean the same thing)

3a. This chance is equal to: 1% per year over 100. This requires a little math, but you can do it!

e.g.

age 100 or less never die naturally.

age 113 has a 13% chance of death.

age 200 has 100% chance of dying naturally.

This can be an expression, or you can tuck it away in another function to make your code readable!

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

(Organize your code! Make two functions birthChance and deathChance to handle these complex parts of the peopleMotion )