turtles-own
[list of variables]
Parameters:
[list of variables] |
List |
A list of variable names to define as turtle variables |
Description:
Defines a set of variables to be properties of turtles. The
[list of variables] contains one or more names. This line of code should be placed at the top of the Turtle Command Center. It does not go inside procedures.
A variable name may be followed by a list of state values
. This variable may only have the values listed in the state value list. This can be used to assign named constants to a variable instead of using numbers.
Examples:
turtles-own [size energy]
turtles-own [weather [sunny cloudy rainy]]
set weather rainy
set weather cloudy
if weather = sunny [ setcolor yellow ]
Notes:
turtles-own
declarations should appear outside of any procedure, usually at the top of the turtle procedures pane.
turtles-own
declarations can contain more than one variable. If you have more than one turtles-own
, consider consolidating them into a single turtles-own
.
Related Commands:
breeds
globals
patches-own