breed
breed <breeds> <breed>
This keyword, like the globals, turtles-own, and patches-own keywords, can only be used at the beginning of the Code tab, before any procedure definitions. It defines a breed. The first input defines the name of the agentset associated with the breed. The second input defines the name of a single member of the breed.
Any turtle of the given breed:
- is part of the agentset named by the breed name
- has its breed built-in variable set to that agentset
Most often, the agentset is used in conjunction with ask to give commands to only the turtles of a particular breed.
breed [mice mouse]
breed [frogs frog]
to setup
clear-all
create-mice 50
ask mice [ set color white ]
create-frogs 50
ask frogs [ set color green ]
show [breed] of one-of mice ;; prints mice
show [breed] of one-of frogs ;; prints frogs
end
show mouse 1
;; prints (mouse 1)
show frog 51
;; prints (frog 51)
show turtle 51
;; prints (frog 51)See also globals, patches-own, turtles-own, <breeds>-own, create-<breeds>, <breeds>-at, <breeds>-here.