Variables

What's the difference between the different types of variables?

Solution: 

Variable DrawerVariable DrawerA variable is a declaration that a trait exists. Something along the lines of "I declare that I have a Hair Color." Agents don't know that they have a trait until you tell them they do.

Agent Variables (in blue) is the set of variables that you're more likely to use. When you declare an agent variable, each agent carries its own value, and they can all be different. We all have different hair and eye colors, groups of friends, we're not all male and not all female, etc. When you put an agent variable declaration in the Everyone panel, all agents of all breeds have that trait. If you put it in the panel of a specific breed, only that breed will have that trait.

Shared variables are the other kind of variable. They hold values that apply to all turtles. Things like night or day, amount of pollution, rate of grass growth, hatch thresholds, etc.

Number variables, for either Agent Variables or Shared Variables, naturally contain numbers as their values. Amounts, ID numbers, and color numbers are a few examples.

A Boolean variable, for either agent or shared variables, contains a yes or a no. This can be used for immunity in a disease model, or asking if an agent is active or inactive, alive or dead, etc.

Text is just what it sounds like. It's a string of letters, words, or other characters. If you'd like each breed to have a catch phrase that they say, this is what you'd use.

A Number List is a list of numbers. Each number also has a position within the list (first, last, 1, 2, 3, 7, etc.). This can be used to keep track of friends in a network, or predators nearby, or patches visited.

A Boolean List is a list of YESes and NOs. You can also think of it as a list of binary values; 0s and 1s.

Submitted by talaya on 6. March 2009 - 19:14